{"name":"std-env","version":"4.0.0","license":"MIT","_id":"std-env@4.0.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":"ba3dc31c3a46bc5ba21138aa20a6a4ceb5bb9b7e","tarball":"http://registry-npm.ywwl.com/std-env/download/std-env-4.0.0.tgz","fileCount":5,"integrity":"sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==","signatures":[{"sig":"MEQCIFDopmpG7LciGCK6rAzgzSAzP4CsuA2KGPXo+EYYsfHRAiAryUeLcFU8mq8oq8RohIry0oS4DB0R8jZJvnQ7pjcIEw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17242,"size":6343,"noattachment":false,"key":"/std-env/-/std-env-4.0.0.tgz"},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs"},"gitHead":"2b364bdb44d7e56e0fe2070758dd42fec55c6144","scripts":{"dev":"vitest","lint":"oxlint . && oxfmt","test":"pnpm lint && pnpm typecheck && vitest run --coverage","build":"obuild","prepack":"obuild","release":"pnpm test && pnpm build && changelogen --release --publish && git push --follow-tags","lint:fix":"oxlint --fix . && oxfmt","typecheck":"tsgo --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/unjs/std-env.git","type":"git"},"_npmVersion":"11.6.2","description":"Runtime agnostic JS utils","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.30.0","devDependencies":{"oxfmt":"^0.33.0","mitata":"^1.0.34","obuild":"^0.4.28","oxlint":"^1.48.0","rollup":"^4.57.1","vitest":"^4.0.18","esbuild":"^0.27.3","typescript":"^5.9.3","@types/node":"^25.2.3","changelogen":"^0.6.2","@vitest/coverage-v8":"^4.0.18","@typescript/native-preview":"^7.0.0-dev.20260217.1"},"_npmOperationalInternal":{"tmp":"tmp/std-env_4.0.0_1773106100456_0.6770816810733173","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":1773106100614,"_cnpm_publish_time":1773106100614,"dist-tags":{"latest":"4.3.0"}}