{"_id":"rsc-env","_rev":"1-9cdbe752d42ecce8c9b40f22c732b43d","name":"rsc-env","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"rsc-env","version":"0.0.1","description":"Discriminates between react-server and other environments","author":{"name":"Loris Sigrist"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/LorisSigrist/rsc-env.git"},"homepage":"https://github.com/LorisSigrist/rsc-env","keywords":["rsc","react-server-components","nextjs","next","next-14","app-router","rsc-env","esm-env"],"type":"module","license":"MIT","main":"not-rsc.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","react-server":"./rsc.js","default":"./not-rsc.js"}},"_id":"rsc-env@0.0.1","gitHead":"d492927419bd3fc380e84ddcc5f00acc5e60b631","bugs":{"url":"https://github.com/LorisSigrist/rsc-env/issues"},"_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"integrity":"sha512-34kQwlfWn7J/vWsV2yVPf8gupoVzH3UsXdoYJ4DpBsDzoVA5HMuiPemPv/TQ6nfB6ifu6RkKMiA05tSFeaQjmw==","shasum":"16ea19c9f790b1d1eabf3b0d120986a9dcfa762a","tarball":"https://registry.npmjs.org/rsc-env/-/rsc-env-0.0.1.tgz","fileCount":6,"unpackedSize":2705,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIHrKwKQ1UcTmY1fgooNH5hVsw4zVESPu04bTUhBVGPAIhAJZB5IagLT+w55JMplbHAHBD0bYssDaVVS9SqNYOVC4r"}]},"_npmUser":{"name":"lurmwoch","email":"sigrist@hasch.io"},"directories":{},"maintainers":[{"name":"lurmwoch","email":"sigrist@hasch.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rsc-env_0.0.1_1713429131356_0.9642203593720224"},"_hasShrinkwrap":false},"0.0.2":{"name":"rsc-env","version":"0.0.2","description":"Discriminates between react-server and other environments","author":{"name":"Loris Sigrist"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/LorisSigrist/rsc-env.git"},"homepage":"https://github.com/LorisSigrist/rsc-env","sideEffects":false,"keywords":["rsc","react-server-components","nextjs","next","next-14","app-router","rsc-env","esm-env"],"type":"module","license":"MIT","main":"not-rsc.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","react-server":"./rsc.js","default":"./not-rsc.js"}},"_id":"rsc-env@0.0.2","gitHead":"ebb357c4ae8f82f29a6b446ff47a9a3459427374","bugs":{"url":"https://github.com/LorisSigrist/rsc-env/issues"},"_nodeVersion":"21.7.3","_npmVersion":"10.5.0","dist":{"integrity":"sha512-ixLbILtzlGEBl25ATa+jBwdKY6GgoN8XwFho+7ycVpCCJ9ijXlWQB0UnLGGU6aWtL+pTzlcaKI7W0xVQjnL5uA==","shasum":"03b8a6c05086cbe7819382d6bacfa2c3e1bb7fe8","tarball":"https://registry.npmjs.org/rsc-env/-/rsc-env-0.0.2.tgz","fileCount":6,"unpackedSize":2728,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBvaishGUKe1UV38NNh2UTAhKi8XsFJS/Z4W8AjNaaTbAiBun/fzV5yWllJFW4DbW/w4tdoradddS4PNgr4/YNJ80Q=="}]},"_npmUser":{"name":"lurmwoch","email":"sigrist@hasch.io"},"directories":{},"maintainers":[{"name":"lurmwoch","email":"sigrist@hasch.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rsc-env_0.0.2_1713797287986_0.35724833736865325"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-18T08:32:11.247Z","0.0.1":"2024-04-18T08:32:11.522Z","modified":"2024-04-22T14:48:08.329Z","0.0.2":"2024-04-22T14:48:08.134Z"},"maintainers":[{"name":"lurmwoch","email":"sigrist@hasch.io"}],"description":"Discriminates between react-server and other environments","homepage":"https://github.com/LorisSigrist/rsc-env","keywords":["rsc","react-server-components","nextjs","next","next-14","app-router","rsc-env","esm-env"],"repository":{"type":"git","url":"git+https://github.com/LorisSigrist/rsc-env.git"},"author":{"name":"Loris Sigrist"},"bugs":{"url":"https://github.com/LorisSigrist/rsc-env/issues"},"license":"MIT","readme":"# RSC-ENV\n\nInspired by the brilliant [`esm-env`](https://github.com/benmccann/esm-env?tab=readme-ov-file)\n\nUses export conditions to return if the current environment is `react-server` or not. Bundlers can statically determine the environment at build time & remove dead code.\n\nThis is useful for writing utility functions that may be called by either server or client components.\n\n## Example\n\n```bash\nnpm install rsc-env\n```\n\n```ts\n// utils/shared.ts\nimport { rsc } from \"rsc-env\";\n\n// This code will be treeshaken from client-component builds\nif(rsc) console.log(\"I'm running in a server component\")\n```\n\n## License\n\n[MIT](./LICENSE.md)\n","readmeFilename":"README.md"}