{"_id":"@avikalpa/environment","_rev":"12-aee4381818c412dc37b64cfe5a15f1fe","name":"@avikalpa/environment","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@avikalpa/environment","version":"1.0.0","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.0","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"6ab166dee1ecb13472a6845b2425eab16afb46f2","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.0.tgz","integrity":"sha512-wek0J0BYipH+GY6OZf3jXzmUI155bAQxTLCqqRjTYGHEfZNKjgbBJ2YWc8GK9QD4q1IiPCLd30zYTVHVUUuMcA==","signatures":[{"sig":"MEUCICxahw/WdYTh37gOrUkwgkO4zpENcIUYo/JigbmJ7PrSAiEAkyrWykytd5Y3A1D6zu+/h1Ba9pbuPB3zLOBpD7HYBJI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.4.2","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.0.tgz_1507684971854_0.32412489340640604","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@avikalpa/environment","version":"1.0.1","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.1","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"f51c577125c14c4e94fee2bd61341481c3dd83ca","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.1.tgz","integrity":"sha512-aBU2PS6Vma/WWyRhSdXVzWCFNUiVSbQEnTqxVeIaaSkg3Q6Ld+AlKX7Y4UmU/OOrs3RJbYVN70/8Z37r/eAFEg==","signatures":[{"sig":"MEUCIQC813g4EwCH3yKFBwVtZqw0+3c7gxRbfq8ryn7UVWg1SQIgUxAmqhcuHaj3kgb/unAJ2g314Pd+4HVwbWWpOgHKNc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.1.tgz_1508099504635_0.8632278724107891","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@avikalpa/environment","version":"1.0.2","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.2","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"a90096aa0ac0f5ca37fb36d272073ce6e447fdd0","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.2.tgz","integrity":"sha512-cnsoGjSHtBpEIa5vzVkERd6fZKyTCl1k41BSEcP6UM3+UDcLjFltqDXxH5Gxz1qEhWZLvjnDLicK5EXFnkrJow==","signatures":[{"sig":"MEMCH0KEIZ8y+NSZhauiQISuWOFRNgCJSy7OnEEfiAY+/BECIAOjsyPD3jEZFxGZeprbIY+WrXcDWkPd/b0PTU62h+C9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.2.tgz_1508099704093_0.09065142716281116","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@avikalpa/environment","version":"1.0.3","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.3","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"88e6401be55be6395a6a2b6ab218d0e54df1b08b","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.3.tgz","integrity":"sha512-BGtkwFUBPKG22pSQdB9wGLGq2IRh9/mtjfyDLMt05dJTQRQP/BzzCnYSYxFXTVE9LZPoohDJuPfJBsEXj5MGcA==","signatures":[{"sig":"MEQCIAj0reOCcnrbUNsFdv2MglPRJHtChPpV1/b1E48Id75HAiBiocG1HT0fV2uuKOauo5Im5H/CG/b+yoD+dWYHZFVQHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.3.tgz_1508099916294_0.5428731807041913","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@avikalpa/environment","version":"1.0.4","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.4","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"060fa5e733fa46db9b4642cf468171f4d8499b44","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.4.tgz","integrity":"sha512-Pvgpk+Zk40HZsLEPFcSnf2Y10cKZyfC1XEO1rFFKDIaxjoK5t26iJWYENkEGKAKI/km8Ht6JEXV1xy2Moam5wQ==","signatures":[{"sig":"MEUCIQDq6qd5xNnVCo97Lx6s4Ww1quXuOMoF/Thp8hU8PJJtXgIgPCsi8e10F1w3xOfAw4MT273FoQCcxKUNKMJpD5whTiI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.4.tgz_1508100052244_0.03261934663169086","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@avikalpa/environment","version":"1.0.5","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.0.5","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"a99476ae8de53d2fbf893c4f1b7cf0f75a7e9fe9","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.0.5.tgz","integrity":"sha512-Na93cybVyJFUxvYqkLOmRmUt/gEHuaMQUWFQaFVuBMf5sXIqLDnhBMQm8V71lBhMxKCvDRELR67ICvfT1Cc8Ow==","signatures":[{"sig":"MEUCIQCjFMnML7mtCh2lW4ag7T91ca94u2Se4sCiRfXOFPwphAIgRyEzOP7iY20n9JRk2NCV8F6s5ySrgffopr3CkehDVYM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.0.5.tgz_1508102130082_0.3353949971497059","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@avikalpa/environment","version":"1.1.0","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.1.0","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"dist":{"shasum":"21f03525ce1f6dfb08f1aa5c47ed62d77b3e3f16","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.1.0.tgz","integrity":"sha512-KdOC+/KP79GNgzhGLLVVbZsl+NHnRp1NA+Y5QpQMDlTjP7Kl3PeAX4pGGOibRwT7ZEKHi8vqVjt901vlFeqRvA==","signatures":[{"sig":"MEYCIQCPPKOVpCmfk864td1oJB4kFvhx+OL+JX58KqVN6x2YpAIhAI53gc7lIEzyCqZNS3pqhf6HLIQA73ehPBIImM9P7SAI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_npmVersion":"5.5.1","description":"Provides only two functions |isNode()| and |isBrowser()| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in bro","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.1.0.tgz_1508104863748_0.9413941991515458","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@avikalpa/environment","version":"1.1.1","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.1.1","maintainers":[{"name":"avikalpa","email":"avikalpakundu@gmail.com"}],"homepage":"https://github.com/avikalpa/environment#readme","bugs":{"url":"https://github.com/avikalpa/environment/issues"},"dist":{"shasum":"03bda797ab9cb43276dff6b160a1050225a88a4d","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.1.1.tgz","integrity":"sha512-/f+yGPBK1kMQ7POj+8J+fGIOvlKyguERByI9mqC5Fx72JSUvEiu1clfzcO116YrEkT8PCwIikAWpHsOlG0tV+w==","signatures":[{"sig":"MEUCIQDDuIKZl4jnPlL0tWzeKJ5ZcmlsVqH7yC/KbpToHNY81AIgZcY+zjkj7EwUgIXtr/fuVHrOsfOQOTleSDEq1xnfESI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"7c13d49f0b9a7aeed1ff28f5e5bff95d4ae83478","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"avikalpa","email":"avikalpakundu@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/avikalpa/environment.git","type":"git"},"_npmVersion":"5.5.1","description":"Provides only two flags |isNode| and |isBrowser| for detection of js runtime environment. Useful for unit testing where specific tests are only suited in one of the environments. For example, a test using |requestAnimationFrame| must be run in browser (us","directories":{},"_nodeVersion":"6.11.2","_npmOperationalInternal":{"tmp":"tmp/environment-1.1.1.tgz_1508106408381_0.9827088702004403","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@avikalpa/environment","version":"1.2.0","author":{"name":"Avikalpa Kundu"},"license":"MIT","_id":"@avikalpa/environment@1.2.0","maintainers":[{"name":"avikalpa","email":"avikalpa@gour.top"}],"homepage":"https://github.com/avikalpa/runtime-environment-flags#readme","bugs":{"url":"https://github.com/avikalpa/runtime-environment-flags/issues"},"dist":{"shasum":"1fb5ac09f0244289765457c83fd58e3e5302e460","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.2.0.tgz","fileCount":5,"integrity":"sha512-5ggZq2rP1bk/bFdDaRyK4SiEIpECd+ulqoSvy7acn+iZxL0u5DQoFLAfxG8xqkcTA9EXJ0N2np2L7T7/MIDg9A==","signatures":[{"sig":"MEQCIG/nLBjIgVGnciV/0Bti60lWLL43Zu29/MoBhfyOrRTaAiAdOHG92IBD/fn3wuPvBmMgQqRl31b7QT9l4kvoiqfLQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@avikalpa%2fenvironment@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":3044},"main":"index.js","type":"commonjs","types":"index.d.ts","gitHead":"cce31a604cc5b661dbdf64b919c87b402187f97e","scripts":{"test":"bun test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9e9fba5f-483d-4beb-ac26-1b662d73d616"}},"repository":{"url":"git+https://github.com/avikalpa/runtime-environment-flags.git","type":"git"},"_npmVersion":"11.10.1","description":"Runtime environment flags for JavaScript: isNode and isBrowser.","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/environment_1.2.0_1771851417614_0.7280841936409557","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@avikalpa/environment","version":"1.3.0","description":"Tiny runtime environment flags for JavaScript.","main":"./index.js","module":"./index.mjs","type":"commonjs","types":"./index.d.ts","exports":{".":{"types":{"import":"./index.d.mts","require":"./index.d.ts"},"import":"./index.mjs","require":"./index.js","default":"./index.js"}},"sideEffects":false,"engines":{"node":">=14"},"scripts":{"test":"bun test"},"author":{"name":"Avikalpa Kundu"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/avikalpa/runtime-environment-flags.git"},"homepage":"https://github.com/avikalpa/runtime-environment-flags#readme","bugs":{"url":"https://github.com/avikalpa/runtime-environment-flags/issues"},"publishConfig":{"provenance":true,"access":"public"},"gitHead":"425e3b4d6009fd47fe25e56363ace7e2dc854e64","_id":"@avikalpa/environment@1.3.0","_nodeVersion":"20.20.0","_npmVersion":"11.10.1","dist":{"integrity":"sha512-VnsY3PfRzSC28SdRVhNZ+GK6zCPq/vsp8dbit/npZQvB/gj8Xesn1Nq3YRVjwICI5fRb8qZgNMeyL4GMkNZygg==","shasum":"c450539e63140632c04943e47a33029cf4207e85","tarball":"https://registry.npmjs.org/@avikalpa/environment/-/environment-1.3.0.tgz","fileCount":10,"unpackedSize":7304,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@avikalpa%2fenvironment@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBUAwAECiSNkIiPR7AKDxTTTeAyeL78PgsMOh2AHufpJAiAxeFNluEabhBJ+vCcnh9wqhj8sSZRbpIE0GpqBH5/UqA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9e9fba5f-483d-4beb-ac26-1b662d73d616"}},"directories":{},"maintainers":[{"name":"avikalpa","email":"avikalpa@gour.top"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/environment_1.3.0_1771851760338_0.9237362490543697"},"_hasShrinkwrap":false}},"time":{"created":"2017-10-11T01:22:51.966Z","modified":"2026-02-23T13:02:40.747Z","1.0.0":"2017-10-11T01:22:51.966Z","1.0.1":"2017-10-15T20:31:44.765Z","1.0.2":"2017-10-15T20:35:04.246Z","1.0.3":"2017-10-15T20:38:36.354Z","1.0.4":"2017-10-15T20:40:52.382Z","1.0.5":"2017-10-15T21:15:30.167Z","1.1.0":"2017-10-15T22:01:03.866Z","1.1.1":"2017-10-15T22:26:48.493Z","1.2.0":"2026-02-23T12:56:57.744Z","1.3.0":"2026-02-23T13:02:40.472Z"},"bugs":{"url":"https://github.com/avikalpa/runtime-environment-flags/issues"},"author":{"name":"Avikalpa Kundu"},"license":"MIT","homepage":"https://github.com/avikalpa/runtime-environment-flags#readme","repository":{"type":"git","url":"git+https://github.com/avikalpa/runtime-environment-flags.git"},"description":"Tiny runtime environment flags for JavaScript.","maintainers":[{"name":"avikalpa","email":"avikalpa@gour.top"}],"readme":"# @avikalpa/environment\n\nTiny runtime flags for JavaScript environments.\n\n- `isNode`: `true` in Node.js.\n- `isBrowser`: `true` in browser main thread.\n- `isWorker`: `true` in web worker/service worker-like runtimes.\n- `runtime`: `'node' | 'browser' | 'worker' | 'unknown'`.\n\n## Install\n\n```bash\nnpm i @avikalpa/environment\n```\n\n## Usage\n\n```js\nconst Environment = require('@avikalpa/environment');\n\nif (Environment.isBrowser) {\n  // browser-only code\n}\n\nif (Environment.isNode) {\n  // node-only code\n}\n\nconsole.log(Environment.runtime);\n```\n\n## Runtime Table\n\n| Environment | isNode | isBrowser | isWorker | runtime |\n| --- | --- | --- | --- | --- |\n| Node.js | true | false | false | `node` |\n| Browser main thread | false | true | false | `browser` |\n| Worker | false | false | true | `worker` |\n| Unknown/other | false | false | false | `unknown` |\n\n## Test\n\n```bash\nbun test\n```\n\n## Changelog\n\nSee [`CHANGELOG.md`](./CHANGELOG.md).\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## Security\n\nSee [`SECURITY.md`](./SECURITY.md).\n\n## License\n\nMIT - see [`LICENSE`](./LICENSE).\n","readmeFilename":"README.md"}