What is @types/is-ci?
@types/is-ci is a TypeScript type definition package for the is-ci library, which is used to detect if a code is running in a Continuous Integration (CI) environment.
What are @types/is-ci's main functionalities?
Detect if running in CI
This feature allows you to check if your code is running in a CI environment. The isCI variable will be true if the code is running in a CI environment, and false otherwise.
const isCI = require('is-ci');
if (isCI) {
console.log('Running in a CI environment');
} else {
console.log('Not running in a CI environment');
}
List of CI environments
This feature provides additional information about the CI environment, such as whether it is a CI environment and the name of the CI service.
const isCI = require('is-ci');
console.log(isCI.isCI); // true or false
console.log(isCI.name); // Name of the CI environment, e.g., 'Travis CI'
Other packages similar to @types/is-ci
ci-info
ci-info is a library that provides information about the current Continuous Integration environment. It offers more detailed information compared to is-ci, such as the name of the CI service and whether it is a known CI service.
env-ci
env-ci is a library that detects the CI environment and provides detailed information about it, including the branch name, commit SHA, and other environment-specific details. It is more comprehensive than is-ci and is useful for more complex CI/CD workflows.