detect-node
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,1 +0,1 @@ | ||
module.exports = (typeof process === 'object') && Object.prototype.toString.call(process) === '[object process]' ? true : false; | ||
module.exports = Object.prototype.toString.call( (global || window).process ) === '[object process]' ? true : false; |
{ | ||
"name": "detect-node", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Detect Node.JS (as opposite to browser environment) (reliable)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,1 +12,10 @@ Usage: | ||
The check is performed as: | ||
```js | ||
module.exports = | ||
Object.prototype.toString.call( (global || window).process ) === '[object process]' ? | ||
true : false; | ||
``` | ||
Thanks to Ingvar Stepanyan for the initial idea. This check is both **the most reliable I could find** and it does not use `process` env directly, which causes browserify to include it into the build. |
1213
21