New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jf/node-env-tools

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jf/node-env-tools

Tools for working with process.env.NODE_ENV including check environment.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

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());

Keywords

development

FAQs

Package last updated on 12 Aug 2021

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