0.3.1 • Published 8 years ago
enviro-conf v0.3.1
Environment Configuration
A simple node.js environment variable config loader inspired by The Twelve Factor App
Installation
$ npm install enviro-conf --save
Usage
Setup environment variables:
$ export PORT=3000 FEATURE=something
Accessing config properties:
var config = require('enviro-conf');
//...
var port = config.get('PORT');
server.listen(port, ...);
config.get()
will throw an exception for undefined keys to help catch typos and missing values.
Check if config properties exist:
var config = require('enviro-conf');
//...
if (config.has('FEATURE')) {
var detail = config.get('FEATURE');
//...
}
Tests
$ npm test