{"versions":{"1.1.0":{"name":"detect-node-es","version":"1.1.0","description":"Detect Node.JS (as opposite to browser environment). ESM modification","main":"es5/node.js","module":"esm/node.js","browser":{"./es5/node.js":"./es5/browser.js","./esm/node.js":"./esm/browser.js"},"types":"es5/node.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/thekashey/detect-node.git"},"keywords":["detect","node"],"author":{"name":"Ilya Kantor"},"license":"MIT","bugs":{"url":"https://github.com/thekashey/detect-node/issues"},"homepage":"https://github.com/thekashey/detect-node","gitHead":"a04ac52015a2052b5006a6f81409fa57987335fb","_id":"detect-node-es@1.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"shasum":"163acdf643330caa0b4cd7c21e7ee7755d6fa493","size":1854,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/detect-node-es/-/detect-node-es-1.1.0.tgz","integrity":"sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="},"_npmUser":{"name":"anonymous","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"thekashey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-node-es_1.1.0_1616029172246_0.45627127939854395"},"_hasShrinkwrap":false,"publish_time":1616029172365,"_cnpm_publish_time":1616029172365,"_cnpmcore_publish_time":"2021-12-16T16:17:50.468Z","contributors":[]},"1.0.0":{"name":"detect-node-es","version":"1.0.0","description":"Detect Node.JS (as opposite to browser environment). ESM modification","main":"es5/node.js","module":"esm/node.js","browser":{"./es5/node.js":"./es5/browser.js","./esm/node.js":"./esm/browser.js"},"types":"es5/node.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/thekashey/detect-node.git"},"keywords":["detect","node"],"author":{"name":"Ilya Kantor"},"license":"ISC","bugs":{"url":"https://github.com/thekashey/detect-node/issues"},"homepage":"https://github.com/thekashey/detect-node","gitHead":"084d6d69cb29e3971ed3fa27dad037d836acfab0","_id":"detect-node-es@1.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"c0318b9e539a5256ca780dd9575c9345af05b8ed","size":1854,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/detect-node-es/-/detect-node-es-1.0.0.tgz","integrity":"sha512-S4AHriUkTX9FoFvL4G8hXDcx6t3gp2HpfCza3Q0v6S78gul2hKWifLQbeW+ZF89+hSm2ZIc/uF3J97ZgytgTRg=="},"maintainers":[{"name":"anonymous","email":"thekashey@gmail.com"}],"_npmUser":{"name":"anonymous","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-node-es_1.0.0_1595846470960_0.6989401874513967"},"_hasShrinkwrap":false,"publish_time":1595846471064,"_cnpm_publish_time":1595846471064,"_cnpmcore_publish_time":"2021-12-16T16:17:50.674Z","contributors":[]}},"dist-tags":{"latest":"1.1.0"},"name":"detect-node-es","time":{"created":"2022-01-26T23:10:07.649Z","modified":"2023-07-31T11:54:35.233Z","1.1.0":"2021-03-18T00:59:32.365Z","1.0.0":"2020-07-27T10:41:11.064Z"},"readme":"## detect-node\n> This is a fork of `detect-node`.\n\nDifferences:\n- uses named export {isNode}\n- has d.ts integrated\n- supports ESM\n\n### Install\n\n```shell\nnpm install --save detect-node-es\n```\n\n### Usage:\n\n```diff\n-var isNode = require('detect-node');\n+var {isNode} = require('detect-node-es');\n\nif (isNode) {\n  console.log(\"Running under Node.JS\");\n} else {\n  alert(\"Hello from browser (or whatever not-a-node env)\");\n}\n```\n\nThe check is performed as:\n```js\nmodule.exports = false;\n\n// Only Node.JS has a process variable that is of [[Class]] process\ntry {\n module.exports = Object.prototype.toString.call(global.process) === '[object process]' \n} catch(e) {}\n\n```\n\nThanks 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 would cause browserify to include it into the build.","users":{}}