1.0.4 • Published 10 years ago

environment-config v1.0.4

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
10 years ago

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);
1.0.4

10 years ago