Package Exports
- cli-env
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cli-env) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Environment
Environment variable management.
Install
npm install cli-env
Test
npm test
Examples
Manage a set of prefixed variables:
var env = require('..')({prefix: 'pkg'});
env.set('directory', '/usr/local/packages');
console.log(env.directory);
console.log(env.get('directory'));
console.log(process.env.pkg_directory);
Import all environment variables:
var env = require('..')({prefix: false, initialize: true});
for(var z in env) {
console.log(z + '=%s', env[z]); // => camelcase keys
}
Import a subset of environment variables matching a regular expression:
var env = require('..')({prefix: false, initialize: true, match: /^lc/i});
for(var z in env) {
console.log(env.getKey(z) + '=%s', env[z]); // => lowercase+underscore
}