{"name":"std-env","version":"4.2.0","description":"Runtime agnostic JS utils","license":"MIT","repository":{"type":"git","url":"git+https://github.com/unjs/std-env.git"},"type":"module","sideEffects":false,"main":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs"},"scripts":{"build":"obuild","dev":"vitest","lint":"oxlint . && oxfmt","lint:fix":"oxlint --fix . && oxfmt","prepack":"obuild","release":"pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags","test":"pnpm lint && pnpm typecheck && vitest run --coverage","typecheck":"tsgo --noEmit"},"devDependencies":{"@types/node":"^26.1.0","@typescript/native-preview":"latest","@vitest/coverage-v8":"^4.1.10","changelogen":"^0.6.2","esbuild":"^0.28.1","mitata":"^1.0.34","obuild":"^0.4.37","oxfmt":"^0.57.0","oxlint":"^1.72.0","rollup":"^4.62.2","typescript":"^6.0.3","vitest":"^4.1.10"},"packageManager":"pnpm@11.10.0","_id":"std-env@4.2.0","bugs":{"url":"https://github.com/unjs/std-env/issues"},"homepage":"https://github.com/unjs/std-env#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==","shasum":"8ebe0ec60485668ab47227b312f4254cdf80c9d3","tarball":"http://registry-npm.ywwl.com/std-env/download/std-env-4.2.0.tgz","fileCount":5,"unpackedSize":17216,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCMEdN7gtl2dgp9w3NT/OWEN5SG+vtiglcEzJlmcGO6sgIhAJKQrCywum/W0opeZV3Mdz0MI+wncxquaGMr78QODMQY"}],"size":6351,"noattachment":false,"key":"/std-env/-/std-env-4.2.0.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/std-env_4.2.0_1783459847189_0.18868803655685706"},"_hasShrinkwrap":false,"readme":"# std-env\n\n[![npm version](https://img.shields.io/npm/v/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env)\n[![npm downloads](https://img.shields.io/npm/dm/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env)\n[![bundle size](https://img.shields.io/bundlephobia/min/std-env/latest.svg?style=flat-square)](https://bundlephobia.com/result?p=std-env)\n\nRuntime-agnostic JS utils for detecting environments, runtimes, CI providers, and AI coding agents.\n\n## Runtime Detection\n\nDetects the current JavaScript runtime based on global variables, following the [WinterCG Runtime Keys proposal](https://runtime-keys.proposal.wintercg.org/).\n\n```ts\nimport { runtime, runtimeInfo } from \"std-env\";\n\nconsole.log(runtime); // \"\" | \"node\" | \"deno\" | \"bun\" | \"workerd\" ...\nconsole.log(runtimeInfo); // { name: \"node\" }\n```\n\nIndividual named exports: `isNode`, `isBun`, `isDeno`, `isNetlify`, `isEdgeLight`, `isWorkerd`, `isFastly`\n\n> [!NOTE]\n> `isNode` is also `true` in Bun/Deno with Node.js compatibility mode. Use `runtime === \"node\"` for strict checks.\n\nSee [./src/runtimes.ts](./src/runtimes.ts) for the full list.\n\n## Provider Detection\n\nDetects the current CI/CD provider based on environment variables.\n\n```ts\nimport { isCI, provider, providerInfo } from \"std-env\";\n\nconsole.log({ isCI, provider, providerInfo });\n// { isCI: true, provider: \"github_actions\", providerInfo: { name: \"github_actions\", ci: true } }\n```\n\nUse `detectProvider()` to re-run detection. See [./src/providers.ts](./src/providers.ts) for the full list.\n\n## Agent Detection\n\nDetects if the environment is running inside an AI coding agent.\n\n```ts\nimport { isAgent, agent, agentInfo } from \"std-env\";\n\nconsole.log({ isAgent, agent, agentInfo });\n// { isAgent: true, agent: \"claude\", agentInfo: { name: \"claude\" } }\n```\n\nSet the `AI_AGENT` env var to explicitly specify the agent name. Use `detectAgent()` to re-run detection.\n\nSupported agents: `cursor`, `claude`, `devin`, `replit`, `gemini`, `codex`, `auggie`, `opencode`, `kiro`, `goose`, `pi`, `junie`\n\n## Flags\n\n```js\nimport { env, isDevelopment, isProduction } from \"std-env\";\n```\n\n| Export             | Description                                                  |\n| ------------------ | ------------------------------------------------------------ |\n| `hasTTY`           | stdout TTY is available                                      |\n| `hasWindow`        | Global `window` is available                                 |\n| `isCI`             | Running in CI                                                |\n| `isColorSupported` | Terminal color output supported                              |\n| `isDebug`          | `DEBUG` env var is set                                       |\n| `isDevelopment`    | `NODE_ENV` is `dev`/`development` or `MODE` is `development` |\n| `isLinux`          | Linux platform                                               |\n| `isMacOS`          | macOS (darwin) platform                                      |\n| `isMinimal`        | `MINIMAL` env is set, CI, test, or no TTY                    |\n| `isProduction`     | `NODE_ENV` or `MODE` is `production`                         |\n| `isTest`           | `NODE_ENV` is `test` or `TEST` env is set                    |\n| `isWindows`        | Windows platform                                             |\n| `platform`         | Value of `process.platform`                                  |\n| `nodeVersion`      | Node.js version string (e.g. `\"22.0.0\"`)                     |\n| `nodeMajorVersion` | Node.js major version number (e.g. `22`)                     |\n\nSee [./src/flags.ts](./src/flags.ts) for details.\n\n## Environment\n\n| Export    | Description                                          |\n| --------- | ---------------------------------------------------- |\n| `env`     | Universal `process.env` (works across all runtimes)  |\n| `process` | Universal `process` shim (works across all runtimes) |\n| `nodeENV` | Current `NODE_ENV` value (undefined if unset)        |\n\n## License\n\nMIT\n","publish_time":1783459847325,"_cnpm_publish_time":1783459847325,"dist-tags":{"latest":"4.3.0"}}