is-in-ci
Check if the process is running in a Continuous Integration (CI) environment
Last updated 4 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-in-ci 
SYNC missed versions from official npm registry.

is-in-ci

Check if the process is running in a Continuous Integration (CI) environment

Install

npm install is-in-ci

Usage

import isInCi from 'is-in-ci';

if (isInCi) {
	console.log('Running in a CI environment');
}

It looks for these environment variables: CI, CONTINUOUS_INTEGRATION, or any with a CI_ prefix.

CLI

is-in-ci && echo 'Running in a CI environment'

Exits with code 0 in CI environments and 1 otherwise.

FAQ

How can I add a CI service?

Request the CI service to include the CI environment variable. Most already do.

How is this different from is-ci?

The is-ci package attempts to detect every CI service, which is unsustainable. It also has a higher risk of false-positives. For example, it detects the environment variable RUN_ID as CI-specific, although other services could use it. Constant updates for new CIs create version fragmentation, resulting in inconsistent behavior across dependent packages. Pushing for CI services to use a standardized CI environment variable is a more robust solution.

Related

Current Tags

  • 1.0.0                                ...           latest (4 months ago)

2 Versions

  • 1.0.0                                ...           4 months ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE