Socket
Socket
Sign inDemoInstall

is-ci

Package Overview
Dependencies
1
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-ci

Detect if the current environment is a CI server


Version published
Weekly downloads
19M
increased by0.34%
Maintainers
2
Install size
24.6 kB
Created
Weekly downloads
 

Package description

What is is-ci?

The is-ci npm package is designed to detect if your code is running in a Continuous Integration (CI) environment. It provides a simple interface to check whether the current execution context is within a CI service by checking environment variables that are typically set by CI services.

What are is-ci's main functionalities?

Detect CI environment

This feature allows you to detect if your application or script is running in a CI environment. The package exports a boolean value that is true if it detects a CI environment based on environment variables. This is useful for altering behavior, such as skipping interactive prompts or enabling more verbose logging, when running in CI.

"use strict";\nconst isCI = require('is-ci');\n\nif (isCI) {\n  console.log('Running in a CI environment');\n} else {\n  console.log('Not running in a CI environment');\n}

Other packages similar to is-ci

Changelog

Source

v3.0.1

  • remove .github folder from published files (dd15229)

Readme

Source

is-ci

Returns true if the current environment is a Continuous Integration server.

Please open an issue if your CI server isn't properly detected :)

npm Tests js-standard-style

Installation

npm install is-ci --save

Programmatic Usage

const isCI = require('is-ci')

if (isCI) {
  console.log('The code is running on a CI server')
}

CLI Usage

For CLI usage you need to have the is-ci executable in your PATH. There's a few ways to do that:

  • Either install the module globally using npm install is-ci -g
  • Or add the module as a dependency to your app in which case it can be used inside your package.json scripts as is
  • Or provide the full path to the executable, e.g. ./node_modules/.bin/is-ci
is-ci && echo "This is a CI server"

Supported CI tools

Refer to ci-info docs for all supported CI's

License

MIT

Keywords

FAQs

Last updated on 26 Oct 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc