Skip to content

configuration through demanding common config and updating it with environment-dependent part

License

Notifications You must be signed in to change notification settings

Mormehtar/extending-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extending-config

Configuration through demanding common config and updating it with environment-dependent part

Installation

npm i extending-config --save

Usage

Require configurator like this: var configurator = require("extending-config");

And get config then using configurator. It accepts options like this:

basePath path to your config directory. Defaults to your cwd / 'config'

environment your current environment defaults to your NODE_ENV or 'development'

common base part of your config, defaults to 'common'. Use false if you don``t want to have common part of config.

Common config would be updated by environment config. Then get config like this:

var config = configurator();

Be careful not to use one config as base for two different environments in the same process run. They are not copied and my be mixed!

Tests

To test run: npm test

You also can look usage of module in tests/test.js.

About

configuration through demanding common config and updating it with environment-dependent part

Resources

License

Stars

Watchers

Forks

Packages

No packages published