Skip to content

Instantly share code, notes, and snippets.

@rwaldron
Last active October 11, 2015 19:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rwaldron/3906504 to your computer and use it in GitHub Desktop.
Save rwaldron/3906504 to your computer and use it in GitHub Desktop.
Are you really in node? Look for `process` and check its `[[Class]]`
// https://github.com/joyent/node/blob/master/src/node.cc
// Look for: process_template->SetClassName(String::NewSymbol("process"));
//
console.log(
typeof process !== "undefined" && {}.toString.call(process) === "[object process]"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment