{"_id":"is-node-process","_rev":"3551267","name":"is-node-process","description":"Reliably determines if the code is running in Node.js","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"kettanaito","email":""}],"time":{"modified":"2024-09-19T02:42:52.000Z","created":"2021-07-19T13:18:28.475Z","1.2.0":"2023-03-23T16:43:26.667Z","1.1.0":"2023-03-23T16:29:26.457Z","1.0.1":"2021-07-23T09:20:36.139Z","1.0.0":"2021-07-19T13:18:28.475Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/mswjs/is-node-process.git"},"versions":{"1.2.0":{"name":"is-node-process","description":"Reliably determines if the code is running in Node.js","version":"1.2.0","main":"lib/index.js","module":"lib/index.mjs","typings":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.mjs"}},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mswjs/is-node-process.git"},"devDependencies":{"@ossjs/release":"^0.5.1","@types/jest":"^27.0.0","@types/node":"^18.14.0","electron":"^19.0.6","jest":"^27.0.6","playwright":"^1.22.2","spectron":"^15.0.0","ts-jest":"^27.0.3","tsup":"^6.2.3","typescript":"^4.3.5"},"scripts":{"browser":"open test/browser.html","electron":"electron test/fixtures/electron.js","test":"jest --testPathIgnorePatterns electron.test.ts","test:react-native":"cd test/fixtures/react-native && pnpm test","build":"tsup","release":"release publish"},"bugs":{"url":"https://github.com/mswjs/is-node-process/issues"},"homepage":"https://github.com/mswjs/is-node-process#readme","_id":"is-node-process@1.2.0","_integrity":"sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==","_resolved":"/tmp/6f88e60b7b77b70245d074f88c8cc743/is-node-process-1.2.0.tgz","_from":"file:is-node-process-1.2.0.tgz","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"shasum":"ea02a1b90ddb3934a19aea414e88edef7e11d134","size":2199,"noattachment":false,"key":"/is-node-process/-/is-node-process-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-node-process/download/is-node-process-1.2.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-node-process_1.2.0_1679589806456_0.2527080801671431"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-23T16:43:26.667Z","publish_time":1679589806667,"_cnpm_publish_time":1679589806667},"1.1.0":{"name":"is-node-process","description":"Reliably determines if the code is running in Node.js","version":"1.1.0","main":"lib/index.js","typings":"lib/index.d.ts","license":"MIT","repository":{"type":"git","url":"git+https://github.com/mswjs/is-node-process.git"},"devDependencies":{"@ossjs/release":"^0.5.1","@rollup/plugin-node-resolve":"^13.0.2","@types/jest":"^26.0.24","@types/node":"^18.14.0","electron":"^19.0.6","jest":"^27.0.6","playwright":"^1.22.2","rollup":"^2.53.2","rollup-plugin-typescript2":"^0.30.0","ts-jest":"^27.0.3","typescript":"^4.3.5"},"scripts":{"browser":"open test/browser.html","electron":"electron test/fixtures/electron.js","test":"jest --testPathIgnorePatterns electron.test.ts","test:react-native":"cd test/fixtures/react-native && pnpm test","build":"rollup -c rollup.config.ts","release":"release publish"},"bugs":{"url":"https://github.com/mswjs/is-node-process/issues"},"homepage":"https://github.com/mswjs/is-node-process#readme","_id":"is-node-process@1.1.0","_integrity":"sha512-gwXjLrk0kVKDpeTbqT1pa2zVjpGie0yixk9XBkFjphGWG8StnfAdG0r7nXqKGHmk1D39p0WTWDYKl4X1qgm30Q==","_resolved":"/tmp/7f7e4f202391b343b75d6e2b5cca942e/is-node-process-1.1.0.tgz","_from":"file:is-node-process-1.1.0.tgz","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"shasum":"7221da24ddd5e5dc693ab590aafa4c86e9cd5473","size":1575,"noattachment":false,"key":"/is-node-process/-/is-node-process-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-node-process/download/is-node-process-1.1.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-node-process_1.1.0_1679588966251_0.08336500739420538"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-23T16:29:26.457Z","publish_time":1679588966457,"_cnpm_publish_time":1679588966457},"1.0.1":{"name":"is-node-process","description":"Reliably determines if the code is running in Node.js","version":"1.0.1","main":"lib/index.js","typings":"lib/index.d.ts","license":"MIT","scripts":{"browser":"open test/browser.html","electron":"electron test/fixtures/electron.js","test":"jest","test:react-native":"cd test/fixtures/react-native && yarn test","build":"rollup -c rollup.config.ts","prepublishOnly":"yarn build && yarn test"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.2","@types/jest":"^26.0.24","electron":"^13.1.7","jest":"^27.0.6","playwright":"^1.12.3","rollup":"^2.53.2","rollup-plugin-typescript2":"^0.30.0","spectron":"^15.0.0","ts-jest":"^27.0.3","typescript":"^4.3.5"},"_id":"is-node-process@1.0.1","dist":{"shasum":"4fc7ac3a91e8aac58175fe0578abbc56f2831b23","size":1488,"noattachment":false,"key":"/is-node-process/-/is-node-process-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-node-process/download/is-node-process-1.0.1.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-node-process_1.0.1_1627032035996_0.5614490922319704"},"_hasShrinkwrap":false,"publish_time":1627032036139,"_cnpm_publish_time":1627032036139,"_cnpmcore_publish_time":"2021-12-16T18:59:31.884Z"},"1.0.0":{"name":"is-node-process","description":"Reliably determines if the code is running in Node.js","version":"1.0.0","main":"lib/index.js","typings":"lib/index.d.ts","license":"MIT","scripts":{"browser":"open test/browser.html","electron":"electron test/fixtures/electron.js","test":"jest","test:react-native":"cd test/fixtures/react-native && yarn test","build":"rollup -c rollup.config.ts","prepublishOnly":"yarn build && yarn test"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.2","@types/jest":"^26.0.24","detox":"^18.19.0","electron":"^13.1.7","jest":"^27.0.6","playwright":"^1.12.3","rollup":"^2.53.2","rollup-plugin-typescript2":"^0.30.0","spectron":"^15.0.0","ts-jest":"^27.0.3","typescript":"^4.3.5"},"_id":"is-node-process@1.0.0","dist":{"shasum":"7e3f833139aac65d31d21aca81587d6ccda80a10","size":1459,"noattachment":false,"key":"/is-node-process/-/is-node-process-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-node-process/download/is-node-process-1.0.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-node-process_1.0.0_1626700708339_0.35864986975252444"},"_hasShrinkwrap":false,"publish_time":1626700708475,"_cnpm_publish_time":1626700708475,"_cnpmcore_publish_time":"2021-12-16T18:59:32.237Z"}},"readme":"[![Package version](https://img.shields.io/npm/v/is-node-process.svg)](https://www.npmjs.com/package/is-node-process)\n\n# `is-node-process`\n\nReliably determines if the code is running in Node.js\n\n## Motivation\n\nThis library was created to provide a reliable way of determining a Node.js process, taking into account:\n\n- Browser-like environments (JSDOM);\n- Electron renderer process;\n- React Native runtime.\n\n### Why relying on `window` is a bad idea\n\nThere are environments (i.e. JSDOM) that polyfill the global `window` object and some of its API for the sake of emulating browser-like behaviors, while still remaining a Node.js process.\n\n### Why relying on `process` is a bad idea\n\nElectron injects a global `process` object in the browser runtime when run with the `nodeIntegration: true` option.\n\n## Getting started\n\n```sh\n$ npm install is-node-process\n# or\n$ yarn add is-node-process\n```\n\n```js\n// any/code.js\nconst { isNodeProcess } = require('is-node-process')\nisNodeProcess() // true/false\n```\n","_attachments":{},"homepage":"https://github.com/mswjs/is-node-process#readme","bugs":{"url":"https://github.com/mswjs/is-node-process/issues"},"license":"MIT"}