dryrun

1.0.2 • Public • Published

Dryrun

Downloads version License Build Status

Checks if the DRY_RUN environment variable is set to a truthy value. It considers any value truthy other than: unset, "", "0", "false" and "no".

Usage

Simply install with npm or yarn:

npm install dryrun
yarn add dryrun

To use it, import the isDryRun or shouldPerform functions:

const { isDryRun, shouldPerform } = require('dryrun');
console.log(isDryRun());       // true if DRY_RUN was set
console.log(shouldPerform());  // opposite of isDryRun()

Testing

dryrun comes with two handy functions for testing:

const { resetDryRun, setDryRun } = require('dryrun');
 
setDryRun(true);  // explicitly activate DRY_RUN
...
resetDryRun();    // reset DRY_RUN to the environment value

Readme

Keywords

none

Package Sidebar

Install

npm i dryrun

Weekly Downloads

12

Version

1.0.2

License

BSD-3-Clause

Last publish

Collaborators

  • benvinegar
  • billyvg
  • mitsuhiko
  • haza
  • jauer
  • sentry-bot
  • evanpurkhiser
  • lynnagara
  • leedongwei
  • markstory
  • zeeg