1. is-in-ci
Check if the process is running in a Continuous Integration (CI) environment
is-in-ci
Package: is-in-ci
Created by: sindresorhus
Last modified: Fri, 27 Oct 2023 18:32:47 GMT
Version: 0.1.0
License: MIT
Downloads: 743,747
Repository: https://github.com/sindresorhus/is-in-ci

Install

npm install is-in-ci
yarn add is-in-ci

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 POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin