Skip to content

Each app can has different server configurations, the goal of this module is manage them.

License

Notifications You must be signed in to change notification settings

fabioricali/best-config

Repository files navigation

best-config

Each app can has different server configurations, the goal of this module is manage them

Installation

npm install best-config --save

Example

Basic usage

const config = require('best-config')({
  file: 'config1'
});

console.log(config.foo); //=> bar

//Custom path "config" folder
const config = require('best-config')({
  file: 'config1',
  path: './custom/your-folder'
});

//Add configuration to global
/** @namespace _MY_CONFIG_ */
require('best-config')({
  file: 'config1',
  addToGlobalWithName: '_MY_CONFIG_'
});

console.log(_MY_CONFIG_.foo); //=> bar

//Append another config file
const config = require('best-config')({
  file: 'config1.json',
  append: {
      key: 'other',
      file: 'commons.json'
  }
});

console.log(config.other.foo); //=> bar

API

  • fromEnv
  • fromHostname

Please see full documentation

Changelog

You can view the changelog here

License

best-config is open-sourced software licensed under the MIT license

Authors

Fabio Ricali

About

Each app can has different server configurations, the goal of this module is manage them.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published