You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

is-in-ci

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-in-ci

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


Version published
Weekly downloads
382K
increased by9.99%
Maintainers
1
Created
Weekly downloads
 

Package description

What is is-in-ci?

The is-in-ci npm package is a utility that helps determine if the current environment is a Continuous Integration (CI) environment. This can be useful for conditionally running certain scripts or configurations only when in a CI environment.

What are is-in-ci's main functionalities?

Check if in CI environment

This feature allows you to check if the current environment is a CI environment. The module exports a boolean value that is true if the script is running in a CI environment and false otherwise.

const isInCI = require('is-in-ci');
console.log(isInCI); // true if in CI, false otherwise

Check specific CI services

This feature allows you to check if the script is running on specific CI services like Travis CI or CircleCI. The module provides boolean properties for various CI services.

const isInCI = require('is-in-ci');
console.log(isInCI.TRAVIS); // true if running on Travis CI
console.log(isInCI.CIRCLE); // true if running on CircleCI

Other packages similar to is-in-ci

Readme

Source

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.

  • is-inside-container - Check if the process is running inside a container
  • is-interactive - Check if stdout or stderr is interactive

Keywords

FAQs

Package last updated on 26 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc