Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

if-ci

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

if-ci

Easily run npm scripts only when in (or not in) a CI environment.

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
185
decreased by-56.78%
Maintainers
1
Weekly downloads
 
Created
Source

if-ci · Version License Travis CI JavaScript Standard Style

Easily run npm scripts only when in (or not in) a CI environment.

installation

npm i --save-dev if-ci

usage

if-ci ships with two commands, the obvious if-ci as well as if-not-ci. To use them, just prepend them to any existing command in an npm script.

if-ci

Will only run the given command when in a CI environment.

{
  "name": "my-great-package",
  "version": "1.2.34",
  "scripts": {
    "maybeEcho": "if-ci echo \"hello!\""
  }
}

If you have multiple commands in a script, just use it again:

{
  "name": "my-great-package",
  "version": "1.2.34",
  "scripts": {
    "maybeEcho": "if-ci echo \"hello\" && if-ci echo \"world!\""
  }
}

if-not-ci

Works inversely to if-ci and will only run the given command when not in a CI environment.

{
  "name": "my-great-package",
  "version": "1.2.34",
  "scripts": {
    "maybeEcho": "if-not-ci echo \"hello\" && if-not-ci echo \"world!\""
  }
}

contributing

Pull requests and any issues found are always welcome.

  1. Fork the project, and preferably create a branch named something like feat-make-better
  2. Modify as needed
  3. Make sure all tests continue to pass, and it never hurts to have more tests
  4. Push & pull request! :tada:

license

MIT © Bo Lingen / citycide

Keywords

FAQs

Package last updated on 14 Jan 2019

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc