# sindresorhus/is-in-ci architecture

> Architecture diagram of the GitHub repository sindresorhus/is-in-ci, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sindresorhus/is-in-ci
- Repository: https://github.com/sindresorhus/is-in-ci

## Overview

is-in-ci is a small Node.js utility that checks whether either standardized CI environment variable is present with a value other than "0" or "false". Applications can use the resulting boolean directly, or invoke the CLI, which exits with status 0 in CI and 1 otherwise. The runtime implementation and CLI are excerpted; the application-facing and shell behavior is documented in the README.

Main entry points: [`cli.js`](https://github.com/sindresorhus/is-in-ci/blob/main/cli.js) (CLI), [`index.js`](https://github.com/sindresorhus/is-in-ci/blob/main/index.js) (CI detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_process_env[("Process environment")]
node_detector["CI detector<br/>[index.js]"]
node_application(("Node application"))
node_cli["CLI<br/>[cli.js]"]
node_shell(("Shell caller"))

node_process_env -->|"reads variables"| node_detector
node_detector -->|"returns boolean"| node_application
node_cli -->|"imports and checks"| node_detector
node_shell -->|"invokes"| node_cli
node_cli -->|"exits with status"| node_shell

click node_detector "https://github.com/sindresorhus/is-in-ci/blob/main/index.js"
click node_cli "https://github.com/sindresorhus/is-in-ci/blob/main/cli.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_process_env toneAmber
class node_detector,node_cli toneTeal
class node_application,node_shell toneIndigo
```

## Components

### Other components

- **Process environment**
- [CI detector](https://github.com/sindresorhus/is-in-ci/blob/main/index.js): `index.js`
- **Node application**
- [CLI](https://github.com/sindresorhus/is-in-ci/blob/main/cli.js): `cli.js`
- **Shell caller**

## Connections

- Process environment → CI detector: reads variables (evidence: `index.js`)
- CI detector → Node application: returns boolean (evidence: `readme.md`)
- CLI → CI detector: imports and checks (evidence: `cli.js`)
- Shell caller → CLI: invokes (evidence: `readme.md`)
- CLI → Shell caller: exits with status (evidence: `cli.js`)
