processconfig
v0.0.2
Published
Wrapper for process.config
Downloads
4
Readme
processconfig
Wrapper for process.config which throws if a property is not set or empty.
Usage
var config = require('processconfig');
config.read({
// e.g.: read config from a json / yaml file or from process.env...
foo: 'bar1',
home: '/home/pino',
illegal: '',
});
console.log(config('foo')); // > bar1
console.log(config('foooo')); // > throws because foooo is not set
console.log(config('illegal')); // > throws because illegal is empty
Tests
Run npm test
.
License
See LICENSE
file.