dev-check

0.0.2 • Public • Published

dev-check

Reliable, flexible and fast DEV environment verification.

Build Status Coverage Status

Features

The library checks for the DEV environment by verifying the current value of process.env.NODE_ENV. And if there is an occurrence of DEV (case-insensitive) in the value, it is recognized as development.

For example, any of the following values are recognized as development:

  • development
  • my-dev
  • This is DEV
  • DeV-123

Installing

$ npm install dev-check

Usage

dynamic usage

var env = require('dev-check');
 
if(env.isDev) {
    // this is a DEV environment
}

Note that when accessing property isDev, the environment is checked dynamically.

static usage

var isDev = require('dev-check').isDev; // reading environment only once
 
if(isDev) {
    // this is a DEV environment
}

License

Copyright © 2017 Vitaly Tomilov; Released under the MIT license.

/dev-check/

    Package Sidebar

    Install

    npm i dev-check

    Weekly Downloads

    1

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • vitaly.tomilov