https://github.com/fabioricali/best-config
Each app can has different server configurations, the goal of this module is manage them.
https://github.com/fabioricali/best-config
configuration-files configuration-management javascript json node-config
Last synced: 12 months ago
JSON representation
Each app can has different server configurations, the goal of this module is manage them.
- Host: GitHub
- URL: https://github.com/fabioricali/best-config
- Owner: fabioricali
- License: mit
- Created: 2017-09-04T07:24:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T10:04:18.000Z (about 8 years ago)
- Last Synced: 2025-03-07T14:04:57.545Z (about 1 year ago)
- Topics: configuration-files, configuration-management, javascript, json, node-config
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
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
```javascript
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