envs
Track environment variable usage
Last updated 6 years ago by camshaft .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install envs 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.6                                ...           latest (6 years ago)

7 Versions

  • 0.1.6                                ...           6 years ago
  • 0.1.5                                ...           6 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago

Copyright 2014 - 2017 © taobao.org |