{"_id":"std-env@4.3.0","dist":{"shasum":"4e7231b61fd83219aa7f76f71fa8818b07e41321","tarball":"http://registry-npm.ywwl.com/std-env/download/std-env-4.3.0.tgz","fileCount":5,"integrity":"sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==","signatures":[{"sig":"MEUCIBRrJdvdT0WKJ9TELutq6AXRmocSMWw3Gh0Ep7gqJ1fGAiEA0G+jNwrfl0KCge7Z/X1JFC5jhzjdfoblKk0zcAh1I/I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICz8qxpk8G+g1gtnIyCht7qwT++ll70XsImHw2W9P+3eAiAIva2DSvboh/f1JcsCdkVuOt/TVM8Tlq8slBnIniX+Rg=="}],"unpackedSize":18175,"size":6608,"noattachment":false,"key":"/std-env/-/std-env-4.3.0.tgz"},"main":"./dist/index.mjs","name":"std-env","type":"module","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs"},"license":"MIT","scripts":{"dev":"vitest","lint":"oxlint . && oxfmt","test":"pnpm lint && pnpm typecheck && vitest run --coverage","build":"obuild","release":"pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags","lint:fix":"oxlint --fix . && oxfmt","typecheck":"tsgo --noEmit"},"version":"4.3.0","_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"unjs/std-env","type":"git"},"description":"Runtime agnostic JS utils","directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.21.0","_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.70.0","mitata":"^1.0.34","obuild":"^0.4.40","oxlint":"^1.85.0","rollup":"^4.63.5","terser":"^5.51.2","vitest":"^4.1.11","typescript":"^6.0.3","@types/node":"^26.6.3","changelogen":"^0.6.2","@vitest/coverage-v8":"^4.1.11","@typescript/native-preview":"latest"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/std-env_4.3.0_1790685632673_0.15340987613533597"},"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`, `isNub`\n\n> [!NOTE]\n> `isNode` is also `true` in Bun/Deno with Node.js compatibility mode. Use `runtime === \"node\"` for strict checks.\n>\n> `isNub` detects [Nub](https://github.com/nubjs/nub), which augments Node.js rather than replacing it. It is additive: `isNode` is also `true` and `runtime` stays `\"node\"`.\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. GitHub Copilot aliases `github_copilot_vscode_agent` and `github_copilot_cloud_agent` are normalized to `copilot`. Use `detectAgent()` to re-run detection.\n\nSupported agents: `cursor`, `claude`, `copilot`, `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":1790685632756,"_cnpm_publish_time":1790685632756,"dist-tags":{"latest":"4.3.0"}}