node-is-env
v1.0.1
Published
check the node env succinctly
Downloads
6
Readme
how to use
const isEnv = require('node-is-env')()
then NODE_ENV=development node index.js
console.log(isEnv.development) // true
or pass your own envs
const isEnv = require('node-is-env')({ dev: 'development' });
NODE_ENV=production node index.js
console.log(isEnv.dev); // false
Inbuilt strings: 'development', 'testing', 'production', 'staging'
why
I got tired of testing my node envs by typing process.env.NODE_ENV
also, isEnv.development / isEnv.production
is more readable than process.env.NODE_ENV === 'production'