Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sdd/config-layered
node.js config loader enabling multiple nested configs that extend a root config.
https://github.com/sdd/config-layered
Last synced: 15 days ago
JSON representation
node.js config loader enabling multiple nested configs that extend a root config.
- Host: GitHub
- URL: https://github.com/sdd/config-layered
- Owner: sdd
- Created: 2015-06-04T16:38:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:15:54.000Z (about 1 year ago)
- Last Synced: 2024-04-26T18:47:56.345Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# config-layered
This config loader allows multiple nested configs that
inherit from a parent. The root config, all.js, is loaded
first. Then, for each item in a hyphen-separated NODE_ENV,
an extra config is merged in.E.g:
- NODE_ENV = dev: Files loaded = all.js, dev.js
- NODE_ENV = test-unit: Files loaded = all.js, test.js, test-unit.js## Usage
```javascript
var configLayered = require('config-layered')
// default: load config from ./config directory
var config = configLayered();// specified folder: load config fron specific folder
config = configLayered('configuration');```