{"name":"detect-node","version":"2.1.0","description":"Detect Node.JS (as opposite to browser environment) (reliable)","main":"index.js","module":"index.esm.js","browser":"browser.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/iliakan/detect-node.git"},"keywords":["detect","node"],"author":{"name":"Ilya Kantor"},"license":"MIT","bugs":{"url":"https://github.com/iliakan/detect-node/issues"},"homepage":"https://github.com/iliakan/detect-node","gitHead":"00381fd0fdbdefa625ac7b8230adfc1df11d49ad","_id":"detect-node@2.1.0","_nodeVersion":"16.1.0","_npmVersion":"7.12.0","dist":{"integrity":"sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==","shasum":"c9c70775a49c3d03bc2c06d9a73be550f978f8b1","tarball":"http://registry-npm.ywwl.com/detect-node/download/detect-node-2.1.0.tgz","fileCount":6,"unpackedSize":2761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoL0ECRA9TVsSAnZWagAACxoP/3XEIC6oXJUgOl0z/2cG\nY+eSDljcMKqTvKArVrDBbxWr1xXU9I+g1pNrqbibDXRxiwURHWn+gLRDJwws\nTP3tL/jS/ebDIKvxAGZdtiiXVdYA2N8Qbrg60KttffC8CowdefppAx46QDgF\nrzfw5cgmJIIqN0OnwBq2mUuihF/OOAbCXoXbsrPHpefmc9wAt4Z5atgZ1WX+\nhAPAge6E+SAk+AOlkvH/UVjXO07MKDGckqkWGIvZJm6JD573GAnX25gpMM9/\nC5ObH9jorTV2IQw49IdHDsYp6Zwa3fQm1tqw0e+FLldIFwvPLRwDrnif2TAd\nnCXs1jR83XFzsl6Pi5rFNNcuhm9GATSmG7CtmgYpF0pNHXyh+eyXtDqmdVUe\nPwvgoiyAnTUUu2DclGocDNqT3MvAyBzdZX16/sJppqKlBn+whZDey6VrO0f+\nyrDksFhFBQF5/7lX2jAXFcCf4Qm2I0/6kqiCPH5utpoYTqa37FiYGpVflpmY\nGXCE2JnA9lMG9funVl0G0u2LsdxRJLMLLOW13BhN4xjgYfVuOX5gWU4KVRYr\noF3ZNO2gvDLBxP1FHX5i7JOoQpKumiWdjUozjbAgfplmRJwaYh+euqboR03+\nfTEiifDFjUdYu4wBPWlPCgdWrzwf/lOtBZDsD3BzXtNb2q7y6PgJ0dGugXa9\ngOPI\r\n=m3pu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7voJ6WKkXZjWL008NvvveaL6dAMF/yt9eApLm95KGwAiEA0wHaMgy946irmImfZs7/ArIY+0+7mGQZmfQ1+40NXCo="}],"size":1609,"noattachment":false,"key":"/detect-node/-/detect-node-2.1.0.tgz"},"_npmUser":{"name":"iliakan","email":"iliakan@gmail.com"},"directories":{},"maintainers":[{"name":"iliakan","email":"iliakan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/detect-node_2.1.0_1621146884014_0.30255741347595166"},"_hasShrinkwrap":false,"readme":"### Install\n\n```shell\nnpm install --save detect-node\n```\n\n### Usage:\n\n```js\nvar isNode = require('detect-node');\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.\n","publish_time":1621146884130,"_cnpm_publish_time":1621146884130,"dist-tags":{"latest":"2.1.0"}}