🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

envs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envs

Track environment variable usage

0.1.6
latest
Source
npm
Version published
Weekly downloads
4.1K
1.63%
Maintainers
1
Weekly downloads
 
Created
Source

envs

Track environment variable usage

Usage

var envs = require('envs');

// enable tracing
env.trace = true;

console.log(envs('NODE_ENV'));
// "production"

console.log(envs('NONEXISTANT', 'my default value'));
// "my default value"

console.log(env.usages);
// { NODE_ENV: 
//   [ { lineno: '/Users/cameron/Projects/misc/envs/example.js:3:13',
//       defaultVal: undefined,
//       val: 'production' } ],
//  NONEXISTANT: 
//   [ { lineno: '/Users/cameron/Projects/misc/envs/example.js:6:13',
//       defaultVal: 'my default value',
//       val: 'my default value' } ] }

Testing

$ npm test

Keywords

environment

FAQs

Package last updated on 05 May 2014

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