Skip to main content

std-env vs ci-info vs is-ci: Runtime Environment Detection in Node.js (2026)

·PkgPulse Team

TL;DR

std-env is the UnJS runtime environment detection library — detects CI, provider, platform, Node.js version, Bun/Deno, production mode, and more in a single zero-dependency package. ci-info detects CI/CD environments — identifies which CI provider (GitHub Actions, GitLab CI, Jenkins, etc.) and whether it's a PR build. is-ci is the simplest check — a single boolean: are we running in CI or not? In 2026: std-env for comprehensive environment detection, ci-info for detailed CI provider info, is-ci for a quick boolean check.

Key Takeaways

  • std-env: ~15M weekly downloads — UnJS, detects CI + provider + platform + runtime, zero deps
  • ci-info: ~20M weekly downloads — CI provider detection, PR detection, supports 50+ CI services
  • is-ci: ~15M weekly downloads — single boolean isCI, uses ci-info internally
  • Tools use CI detection to: disable interactive prompts, skip colors, adjust verbosity, enable caching
  • std-env also detects Bun, Deno, edge runtimes, production mode — more than just CI
  • is-ci is just require("ci-info").isCI exported as a module

is-ci

is-ci — the simplest check:

Usage

import isCI from "is-ci"

if (isCI) {
  console.log("Running in CI — disabling interactive prompts")
} else {
  console.log("Running locally — full interactive mode")
}

// Common patterns:
const spinner = isCI ? null : createSpinner("Building...")
const colors = isCI ? false : true
const logLevel = isCI ? "info" : "debug"

What it checks

is-ci checks these environment variables:
  CI=true                → Generic CI indicator
  CONTINUOUS_INTEGRATION → Travis CI
  BUILD_NUMBER          → Jenkins
  GITHUB_ACTIONS        → GitHub Actions
  GITLAB_CI             → GitLab CI
  CIRCLECI              → CircleCI
  ... and 50+ more CI providers

ci-info

ci-info — detailed CI detection:

Basic usage

import ci from "ci-info"

ci.isCI          // true if running in any CI
ci.isPR          // true if this is a pull request build
ci.name          // "GitHub Actions" | "GitLab CI" | "Jenkins" | null
ci.id            // "GITHUB" | "GITLAB" | "JENKINS" | null

Provider-specific behavior

import ci from "ci-info"

if (ci.isCI) {
  console.log(`Running on ${ci.name}`)

  if (ci.isPR) {
    // PR-specific behavior:
    console.log("This is a pull request build")
    // Skip deployment, run extra checks, post comments
  }

  switch (ci.id) {
    case "GITHUB":
      // GitHub Actions — use GITHUB_TOKEN, set output
      console.log(`Workflow: ${process.env.GITHUB_WORKFLOW}`)
      console.log(`Run ID: ${process.env.GITHUB_RUN_ID}`)
      break

    case "GITLAB":
      // GitLab CI — use CI_JOB_TOKEN
      console.log(`Pipeline: ${process.env.CI_PIPELINE_ID}`)
      break

    case "JENKINS":
      // Jenkins — use BUILD_URL
      console.log(`Build: ${process.env.BUILD_NUMBER}`)
      break
  }
}

Supported CI providers

ci-info supports 50+ CI providers:
  GitHub Actions, GitLab CI, Jenkins, CircleCI,
  Travis CI, Azure Pipelines, Bitbucket Pipelines,
  AWS CodeBuild, Google Cloud Build, Buildkite,
  Drone, Semaphore, TeamCity, Vercel, Netlify,
  Heroku, Railway, Render, Fly.io, and many more

std-env

std-env — comprehensive environment detection:

CI detection

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

// CI detection (like is-ci):
isCI        // true/false

// Provider name:
provider    // "github_actions" | "gitlab_ci" | "jenkins" | ...

// Full provider info:
providerInfo
// → { name: "github_actions", isCI: true, isPR: true, ... }

Runtime detection

import {
  isNode, isBun, isDeno,
  isWindows, isLinux, isMacOS,
  isEdgeLight, isNetlify, isVercel,
  nodeVersion, nodeMajorVersion,
} from "std-env"

// Runtime:
isNode        // true if Node.js
isBun         // true if Bun
isDeno        // true if Deno

// Platform:
isWindows     // true if Windows
isLinux       // true if Linux
isMacOS       // true if macOS

// Edge runtimes:
isEdgeLight   // true if running in edge runtime
isNetlify     // true if Netlify Functions/Edge
isVercel      // true if Vercel Functions/Edge

// Node.js version:
nodeVersion     // "22.0.0"
nodeMajorVersion // 22

Production/development detection

import { isProduction, isDevelopment, isTest, isDebug } from "std-env"

// Environment mode:
isProduction   // NODE_ENV === "production"
isDevelopment  // NODE_ENV === "development"
isTest         // NODE_ENV === "test"
isDebug        // DEBUG env var is set

// Conditional behavior:
const logLevel = isProduction ? "warn" : isTest ? "silent" : "debug"
const sourceMaps = isProduction ? false : true
const minify = isProduction ? true : false

Process flags

import { hasTTY, isColorSupported, isMinimal } from "std-env"

// Terminal capabilities:
hasTTY            // true if stdout is a TTY
isColorSupported  // true if terminal supports colors

// Minimal mode:
isMinimal         // true if running in a minimal environment

// Useful for CLI tools:
if (!hasTTY) {
  // Non-interactive — no spinners, no prompts
}

if (isColorSupported) {
  // Use colored output
}

Practical example: CLI tool setup

import {
  isCI, provider, hasTTY, isColorSupported,
  isProduction, nodeVersion, isBun
} from "std-env"

function createCLIConfig() {
  return {
    // Disable interactive features in CI:
    interactive: !isCI && hasTTY,

    // Colors based on terminal support:
    colors: isColorSupported && !isCI,

    // Verbose in dev, quiet in CI:
    logLevel: isCI ? "info" : "debug",

    // Show provider info in CI:
    ciProvider: isCI ? provider : null,

    // Runtime info:
    runtime: isBun ? `Bun` : `Node.js ${nodeVersion}`,

    // Production optimizations:
    cache: isProduction,
    sourceMaps: !isProduction,
  }
}

Feature Comparison

Featurestd-envci-infois-ci
CI detection
CI provider name
PR detection
Runtime detection✅ (Node/Bun/Deno)
Platform detection✅ (Win/Mac/Linux)
Edge runtime
Production mode
TTY detection
Color support
Node.js version
Dependencies00ci-info
Weekly downloads~15M~20M~15M

When to Use Each

Use std-env if:

  • Need comprehensive environment detection (CI + runtime + platform)
  • Building cross-runtime tools (Node.js, Bun, Deno)
  • Want one import for all environment checks
  • In the UnJS ecosystem

Use ci-info if:

  • Need detailed CI provider identification
  • Want PR detection for CI-specific logic
  • Building CI/CD tools or GitHub Actions
  • Only need CI-related detection

Use is-ci if:

  • Just need a boolean: "are we in CI?"
  • Simplest possible check
  • Don't need provider info or other detection

Methodology

Download data from npm registry (weekly average, February 2026). Feature comparison based on std-env v3.x, ci-info v4.x, and is-ci v3.x.

Compare environment detection and CI tooling on PkgPulse →

Comments

Stay Updated

Get the latest package insights, npm trends, and tooling tips delivered to your inbox.