{"id":19450472,"url":"https://github.com/mswjs/is-node-process","last_synced_at":"2025-04-25T03:32:05.206Z","repository":{"id":39912610,"uuid":"387290758","full_name":"mswjs/is-node-process","owner":"mswjs","description":"Reliably determines if the code is running in Node.js. Treats Jest, React Native, Electron, and others like Node.js.","archived":false,"fork":false,"pushed_at":"2023-03-23T16:43:29.000Z","size":113,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T17:36:56.449Z","etag":null,"topics":["check","nodejs","process"],"latest_commit_sha":null,"homepage":"https://npm.im/is-node-process","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mswjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-18T23:48:51.000Z","updated_at":"2024-07-12T20:52:11.000Z","dependencies_parsed_at":"2024-06-18T15:35:24.766Z","dependency_job_id":"ad25c81b-0e98-471c-9b32-3a7fe00e58ee","html_url":"https://github.com/mswjs/is-node-process","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fis-node-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fis-node-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fis-node-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mswjs%2Fis-node-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mswjs","download_url":"https://codeload.github.com/mswjs/is-node-process/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250748077,"owners_count":21480775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["check","nodejs","process"],"created_at":"2024-11-10T16:37:53.706Z","updated_at":"2025-04-25T03:32:04.858Z","avatar_url":"https://github.com/mswjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmswjs%2Fis-node-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmswjs%2Fis-node-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmswjs%2Fis-node-process/lists"}