{"name":"std-env","version":"3.9.0","license":"MIT","_id":"std-env@3.9.0","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/unjs/std-env#readme","bugs":{"url":"https://github.com/unjs/std-env/issues"},"dist":{"shasum":"1a6f7243b339dca4c9fd55e1c7504c77ef23e8f1","tarball":"http://registry-npm.ywwl.com/std-env/download/std-env-3.9.0.tgz","fileCount":8,"integrity":"sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==","signatures":[{"sig":"MEUCIQDJMien5I2NMDS5rXAMXAnB0EVK/uVBu/l5Zan88jn4GQIgbdJDd+Ekji8HlYpYuPXRICIx7Eayv7RbCCiFLc2eIks=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26086,"size":6492,"noattachment":false,"key":"/std-env/-/std-env-3.9.0.tgz"},"main":"./dist/index.cjs","types":"./dist/index.d.ts","exports":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"gitHead":"7e8cb7b1000f313a03d7645c82e2d8608c250dd6","scripts":{"dev":"vitest","lint":"eslint . && prettier -c src test","test":"pnpm lint && pnpm typecheck && vitest run --coverage","build":"unbuild","prepack":"unbuild","release":"pnpm test && changelogen --release && npm publish && git push --follow-tags","lint:fix":"eslint --fix . && prettier -w src test","play:bun":"bun playground/bun.ts","play:deno":"pnpm build && deno run -A playground/deno.ts","play:node":"pnpm build && node playground/node.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/unjs/std-env.git","type":"git"},"_npmVersion":"10.9.2","description":"Runtime agnostic JS utils","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.7.1","devDependencies":{"jiti":"^2.4.2","eslint":"^9.23.0","rollup":"^4.39.0","vitest":"^3.1.1","esbuild":"^0.25.2","unbuild":"^3.5.0","prettier":"^3.5.3","typescript":"^5.8.2","@types/node":"^22.14.0","changelogen":"^0.6.1","eslint-config-unjs":"^0.4.2","@vitest/coverage-v8":"^3.1.1"},"_npmOperationalInternal":{"tmp":"tmp/std-env_3.9.0_1743719954778_0.8231437598158966","host":"s3://npm-registry-packages-npm-production"},"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":1743719955007,"_cnpm_publish_time":1743719955007,"dist-tags":{"latest":"4.3.0"}}