npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

std-env

v4.0.0

Published

Runtime agnostic JS utils

Readme

std-env

npm version npm downloads bundle size

Runtime-agnostic JS utils for detecting environments, runtimes, CI providers, and AI coding agents.

Runtime Detection

Detects the current JavaScript runtime based on global variables, following the WinterCG Runtime Keys proposal.

import { runtime, runtimeInfo } from "std-env";

console.log(runtime); // "" | "node" | "deno" | "bun" | "workerd" ...
console.log(runtimeInfo); // { name: "node" }

Individual named exports: isNode, isBun, isDeno, isNetlify, isEdgeLight, isWorkerd, isFastly

[!NOTE] isNode is also true in Bun/Deno with Node.js compatibility mode. Use runtime === "node" for strict checks.

See ./src/runtimes.ts for the full list.

Provider Detection

Detects the current CI/CD provider based on environment variables.

import { isCI, provider, providerInfo } from "std-env";

console.log({ isCI, provider, providerInfo });
// { isCI: true, provider: "github_actions", providerInfo: { name: "github_actions", ci: true } }

Use detectProvider() to re-run detection. See ./src/providers.ts for the full list.

Agent Detection

Detects if the environment is running inside an AI coding agent.

import { isAgent, agent, agentInfo } from "std-env";

console.log({ isAgent, agent, agentInfo });
// { isAgent: true, agent: "claude", agentInfo: { name: "claude" } }

Set the AI_AGENT env var to explicitly specify the agent name. Use detectAgent() to re-run detection.

Supported agents: cursor, claude, devin, replit, gemini, codex, auggie, opencode, kiro, goose, pi

Flags

import { env, isDevelopment, isProduction } from "std-env";

| Export | Description | | ------------------ | ------------------------------------------------------------ | | hasTTY | stdout TTY is available | | hasWindow | Global window is available | | isCI | Running in CI | | isColorSupported | Terminal color output supported | | isDebug | DEBUG env var is set | | isDevelopment | NODE_ENV is dev/development or MODE is development | | isLinux | Linux platform | | isMacOS | macOS (darwin) platform | | isMinimal | MINIMAL env is set, CI, test, or no TTY | | isProduction | NODE_ENV or MODE is production | | isTest | NODE_ENV is test or TEST env is set | | isWindows | Windows platform | | platform | Value of process.platform | | nodeVersion | Node.js version string (e.g. "22.0.0") | | nodeMajorVersion | Node.js major version number (e.g. 22) |

See ./src/flags.ts for details.

Environment

| Export | Description | | --------- | ---------------------------------------------------- | | env | Universal process.env (works across all runtimes) | | process | Universal process shim (works across all runtimes) | | nodeENV | Current NODE_ENV value (undefined if unset) |

License

MIT