environment-config

1.0.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i environment-config

Weekly Downloads

1

Version

1.0.4

License

ISC

Last publish

Collaborators

  • whitelynx