environment-config
v1.0.4
Published
Generic support for environment-specific configuration.
Downloads
22
Readme
environment-config
Generic support for environment-specific configuration.
Installation
npm install environment-config
Loading Configuration
Simple usage:
var envConfig = require('environment-config');
envConfig.loadConfig(require('./config'));
If you want to override the environment that is chosen (e.g., based on command-line options), you may pass the environment name as the first argument:
envConfig.loadConfig('dev', require('./config'));
Querying Configuration Options
After you have loaded configuration (see above), you may access config options from any module:
var config = require('environment-config').config;
console.log("'port' is set to:", envConfig.config.port);