{"_id":"esm-env","_rev":"4177089","name":"esm-env","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","dist-tags":{"latest":"1.2.2"},"maintainers":[{"name":"benmccann","email":""}],"time":{"modified":"2026-03-01T21:37:05.000Z","created":"2022-12-05T20:25:14.246Z","1.2.2":"2025-01-08T20:32:34.154Z","1.2.1":"2024-11-29T00:22:36.887Z","1.2.0":"2024-11-27T23:27:39.413Z","1.1.4":"2024-10-29T22:47:45.558Z","1.1.3":"2024-10-29T22:38:06.778Z","1.1.2":"2024-10-29T21:02:28.278Z","1.1.1":"2024-10-29T16:33:07.939Z","1.1.0":"2024-10-29T16:11:39.374Z","1.0.0":"2022-12-05T20:25:14.246Z"},"users":{},"author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"versions":{"1.2.2":{"name":"esm-env","version":"1.2.2","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./browser":{"browser":"./true.js","development":"./false.js","production":"./false.js","default":"./browser-fallback.js"},"./development":{"development":"./true.js","production":"./false.js","default":"./dev-fallback.js"},"./node":{"node":"./true.js","default":"./false.js"}},"_id":"esm-env@1.2.2","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_integrity":"sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==","_resolved":"/tmp/6e50e3b52c302feda5fe59fd0d2b5495/esm-env-1.2.2.tgz","_from":"file:esm-env-1.2.2.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"shasum":"263c9455c55861f41618df31b20cb571fc20b75e","size":2183,"noattachment":false,"key":"/esm-env/-/esm-env-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.2.2.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/esm-env_1.2.2_1736368353989_0.1587185467136174"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-08T20:32:34.154Z","publish_time":1736368354154,"_source_registry_name":"default","_cnpm_publish_time":1736368354154},"1.2.1":{"name":"esm-env","version":"1.2.1","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./browser":{"browser":"./true.js","development":"./false.js","production":"./false.js","default":"./browser-fallback.js"},"./development":{"development":"./true.js","production":"./false.js","default":"./dev-fallback.js"},"./node":{"node":"./true.js","default":"./false.js"}},"_id":"esm-env@1.2.1","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_integrity":"sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==","_resolved":"/tmp/4ce35b8ae9f5928381d7a0f7ce217d6c/esm-env-1.2.1.tgz","_from":"file:esm-env-1.2.1.tgz","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"shasum":"34c2a0ba60582948afbe7bd779bc66f9d3aece7e","size":2240,"noattachment":false,"key":"/esm-env/-/esm-env-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.2.1.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.2.1_1732839756717_0.8323242244923852"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-11-29T00:22:36.887Z","publish_time":1732839756887,"_source_registry_name":"default","_cnpm_publish_time":1732839756887},"1.2.0":{"name":"esm-env","version":"1.2.0","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","sideEffects":false,"exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./browser":{"browser":"./true.js","default":"./false.js"},"./development":{"development":"./true.js","production":"./false.js","default":"./dev-fallback.js"},"./node":{"node":"./true.js","default":"./false.js"}},"_id":"esm-env@1.2.0","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_integrity":"sha512-OhSQuHL3mUcaQHjGe8UMG8GsJIJHYYz0flR0h9fiTPNMupLMkb7TvcRD0EeJXW5a8GHBgfz08b6FDLNK7kkPQA==","_resolved":"/tmp/da58135ead90b43b9a602adc9c6302ab/esm-env-1.2.0.tgz","_from":"file:esm-env-1.2.0.tgz","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"shasum":"637c0586244c0eb14bfd7f5e96a6b43b9e8f5c2b","size":2305,"noattachment":false,"key":"/esm-env/-/esm-env-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.2.0.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.2.0_1732750059249_0.4359846359260868"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-11-27T23:27:39.413Z","publish_time":1732750059413,"_source_registry_name":"default","_cnpm_publish_time":1732750059413},"1.1.4":{"name":"esm-env","version":"1.1.4","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"types":"./index.d.ts","browser":{"node":{"development":"./browser-dev-node.js","default":"./browser-node.js"},"default":{"development":"./browser-dev.js","default":"./browser.js"}},"default":{"node":{"development":"./dev-node.js","default":"./node.js"},"default":{"development":"./dev.js","default":"./none.js"}}}},"_id":"esm-env@1.1.4","gitHead":"180feb982f0356a56809eed7263b2fa57c61f12f","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.9.0","dist":{"shasum":"340c78b03ee2298d31c5b9fab9793468ede828b0","size":1486,"noattachment":false,"key":"/esm-env/-/esm-env-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.1.4.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.1.4_1730242065309_0.7161221811614087"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-29T22:47:45.558Z","publish_time":1730242065558,"_source_registry_name":"default","_cnpm_publish_time":1730242065558},"1.1.3":{"name":"esm-env","version":"1.1.3","author":{"url":"https://www.benmccann.com","name":"Ben McCann"},"license":"MIT","_id":"esm-env@1.1.3","maintainers":[{"name":"benmccann","email":""}],"homepage":"https://github.com/benmccann/esm-env","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"dist":{"shasum":"d3b975e69f1894eaf860078c41420b922e27f5d3","size":1489,"noattachment":false,"key":"/esm-env/-/esm-env-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.1.3.tgz"},"type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","browser":{"node":{"default":"./browser-node.js","development":"./browser-dev-node.js"},"default":{"default":"./browser.js","development":"./browser-dev.js"}},"default":{"node:":{"default":"./node.js","development":"./dev-node.js"},"default":{"default":"./none.js","development":"./dev.js"}}}},"gitHead":"29169f35b29acdaced66e3e65f57fb20ecddb623","_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"repository":{"url":"git+https://github.com/benmccann/esm-env.git","type":"git"},"_npmVersion":"10.9.0","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/esm-env_1.1.3_1730241486563_0.029997597648580454","host":"s3://npm-registry-packages"},"_cnpmcore_publish_time":"2024-10-29T22:38:06.778Z","publish_time":1730241486778,"_source_registry_name":"default","_cnpm_publish_time":1730241486778},"1.1.2":{"name":"esm-env","version":"1.1.2","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"browser":{"node":{"development":"./browser-dev-node.js","default":"./browser-node.js"},"default":{"development":"./browser-dev.js","default":"./browser.js"}},"default":{"node:":{"development":"./dev-node.js","default":"./node.js"},"default":{"development":"./dev.js","default":"./none.js"}}}},"_id":"esm-env@1.1.2","gitHead":"432d8a636441efa644ca93b9873d53629b7943c7","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.9.0","dist":{"shasum":"76d189554aa251560413eecd133d1b5a86da64b4","size":1479,"noattachment":false,"key":"/esm-env/-/esm-env-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.1.2.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.1.2_1730235748048_0.2295524855087645"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-29T21:02:28.278Z","publish_time":1730235748278,"_source_registry_name":"default","_cnpm_publish_time":1730235748278},"1.1.1":{"name":"esm-env","version":"1.1.1","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.cjs"},"./browser":{"import":{"browser":"./true.mjs","default":"./false.mjs"},"require":{"browser":"./true.cjs","default":"./false.cjs"}},"./development":{"import":{"development":"./true.mjs","default":"./false.mjs"},"require":{"development":"./true.cjs","default":"./false.cjs"}},"./node":{"import":{"node":"./true.mjs","default":"./false.mjs"},"require":{"node":"./true.cjs","default":"./false.cjs"}}},"_id":"esm-env@1.1.1","gitHead":"445e85b2e1ad659d0487d56105cd153b01851ebb","types":"./index.d.ts","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.9.0","dist":{"shasum":"d02858ce396148ecf75f298e4c320d5a929b4015","size":1648,"noattachment":false,"key":"/esm-env/-/esm-env-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.1.1.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.1.1_1730219587758_0.7957991970142009"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-29T16:33:07.939Z","publish_time":1730219587939,"_source_registry_name":"default","_cnpm_publish_time":1730219587939},"1.1.0":{"name":"esm-env","version":"1.1.0","author":{"url":"https://www.benmccann.com","name":"Ben McCann"},"license":"MIT","_id":"esm-env@1.1.0","maintainers":[{"name":"benmccann","email":""}],"homepage":"https://github.com/benmccann/esm-env","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"dist":{"shasum":"c4552e280ee0398eb5be9ff559165265148724cd","size":1650,"noattachment":false,"key":"/esm-env/-/esm-env-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.1.0.tgz"},"type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.cjs"},"./node":{"import":{"node":"./true.mjs","default":"./false.mjs"},"require":{"node":"./true.cjs","default":"./false.cjs"}},"./browser":{"import":{"browser":"./true.mjs","default":"./false.mjs"},"require":{"browser":"./true.cjs","default":"./false.cjs"}},"./development":{"import":{"default":"./false.mjs","development":"./true.mjs"},"require":{"default":"./false.cjs","development":"./true.cjs"}}},"gitHead":"5720091e369a23e22bb9f9200199bcf471a7f1aa","_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"repository":{"url":"git+https://github.com/benmccann/esm-env.git","type":"git"},"_npmVersion":"10.9.0","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/esm-env_1.1.0_1730218299211_0.471238962783435","host":"s3://npm-registry-packages"},"_cnpmcore_publish_time":"2024-10-29T16:11:39.374Z","publish_time":1730218299374,"_source_registry_name":"default","_cnpm_publish_time":1730218299374},"1.0.0":{"name":"esm-env","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/benmccann/esm-env.git"},"license":"MIT","homepage":"https://github.com/benmccann/esm-env","author":{"name":"Ben McCann","url":"https://www.benmccann.com"},"type":"module","exports":{".":{"types":"./index.d.ts","browser":{"development":"./dev-browser.js","default":"./prod-browser.js"},"default":{"development":"./dev-ssr.js","default":"./prod-ssr.js"}}},"types":"./index.d.ts","gitHead":"bddcec345fe2c4f0779a590d389320f4ec60ba2b","description":"Uses export conditions to return environment information in a way that works with major bundlers and runtimes.","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"_id":"esm-env@1.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"shasum":"b124b40b180711690a4cb9b00d16573391950413","size":1357,"noattachment":false,"key":"/esm-env/-/esm-env-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esm-env/download/esm-env-1.0.0.tgz"},"_npmUser":{"name":"benmccann","email":"benjamin.j.mccann@gmail.com"},"directories":{},"maintainers":[{"name":"benmccann","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm-env_1.0.0_1670271914090_0.378788795639039"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-05T20:26:44.982Z","publish_time":1670271914246,"_cnpm_publish_time":1670271914246}},"readme":"# esm-env\n\nUses export conditions to return environment information in a way that works with major bundlers and runtimes.\n\n## Usage\n\nInstall with `npm install esm-env`, then import as needed:\n\n```js\nimport { BROWSER, DEV, NODE } from 'esm-env';\n```\n\nSpecify `conditions` in your bundler or runtime. For example:\n- [Node.js](https://nodejs.org/api/cli.html#-c-condition---conditionscondition)\n- [Bun](https://bun.sh/docs/runtime/modules#custom-conditions)\n- [Vite/Vitest](https://vite.dev/config/shared-options#resolve-conditions)\n- [webpack](https://webpack.js.org/configuration/resolve/#resolveconditionnames)\n\nIf `esm-env` is used in both bundled code and an externalized library, you will need to specify conditions both at build-time and run-time.\n\n## Acknowledgements\n\nThank you to [dominikg](https://github.com/dominikg) for refining the approach used by this library to suggest a more scalable method for adding additional conditions.\n\n## License\n\n[MIT](LICENSE)\n","_attachments":{},"homepage":"https://github.com/benmccann/esm-env","bugs":{"url":"https://github.com/benmccann/esm-env/issues"},"license":"MIT"}