Nobody Pays (for) Magazines
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

node-env-tools

1.0.2 • Public • Published

node-env-tools stable

npm install node-env-tools

Tools for working with process.env.

Examples

const net = require('node-env-tools');
 
// Use value instead of process.env. 
console.log(net.load({ ... }));
 
// Get key if exists, nested objects is allowed. 
console.log(net.get('a.b.c'));
 
// Check if key exists, nested objects is allowed.
console.log(net.has('a.b.c'));
 
// Set value.
console.log(net.set('NODE_ENV', 'testing'));
 
// Check if NODE_ENV is 'production' or '"production"'
console.log(net.isEnv('production'));
 
// Check if NODE_ENV is 'production'
console.log(net.isEnv('production', false));
 
// Check if NODE_ENV is 'dev', '"dev"', 'development' or '"development"'
console.log(net.isDev());
 
// Check if NODE_ENV is 'pro', '"pro"', 'production' or '"production"'
console.log(net.isPro());
 
// Check if NODE_ENV is 'test', '"test"', 'testing' or '"testing"'
console.log(net.isTest());

install

npm i node-env-tools

Downloadsweekly downloads

2

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability