# is-ci

> Detect if the current environment is a CI server

Latest version **4.1.0** (published 2024-12-08) · MIT license · 0 weekly downloads

> **Better alternative:** Use Boolean(process.env.CI) — Consider using a lighter alternative

## Install

```sh
npm install is-ci
pnpm add is-ci
yarn add is-ci
bun add is-ci
```

Provides the command `is-ci`.

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2024-12-08 |
| First published | 2015-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 400 |
| Author | Thomas Watson Steen |
| Maintainers | watson, sibiraj-s |
| Keywords | ci, continuous, integration, test, detect |

## Links

- npm: https://www.npmjs.com/package/is-ci
- Repository: https://github.com/watson/is-ci
- Issues: https://github.com/watson/is-ci/issues
- Funding: https://github.com/sponsors/sibiraj-s
- npm.io page: https://npm.io/package/is-ci

## Dependencies (1)

- [ci-info](https://npm.io/package/ci-info.md) ^4.1.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 4.1.0 (latest) — 2024-12-08
- 4.0.0 — 2024-12-08
- 3.0.1 — 2021-10-26
- 3.0.0 — 2021-02-18
- 2.0.0 — 2018-12-05
- 1.2.1 — 2018-09-09
- 1.2.0 — 2018-08-16
- 1.1.0 — 2018-01-03
- 1.0.10 — 2016-10-20
- 1.0.9 — 2016-07-07
- 1.0.8 — 2016-02-12
- 1.0.7 — 2015-10-16
- 1.0.6 — 2015-10-16
- 1.0.5 — 2015-10-15
- 1.0.4 — 2015-10-08
- … 4 more at https://npm.io/package/is-ci/versions

## README

# is-ci

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

Please [open an issue](https://github.com/watson/is-ci/issues) if your
CI server isn't properly detected :)

[![npm](https://img.shields.io/npm/v/is-ci.svg)](https://www.npmjs.com/package/is-ci)
[![Tests](https://github.com/watson/is-ci/workflows/Tests/badge.svg)](https://github.com/watson/is-ci/actions)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## Installation

```bash
npm install is-ci --save
```

## Programmatic Usage

```js
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`

```bash
is-ci && echo "This is a CI server"
```

## Supported CI tools

Refer to [ci-info](https://github.com/watson/ci-info#supported-ci-tools) docs for all supported CI's

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/is-ci · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
