Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/load-config
Load an nconf configuration by using a file path passed as a command line option
https://github.com/nisaacson/load-config
Last synced: about 1 month ago
JSON representation
Load an nconf configuration by using a file path passed as a command line option
- Host: GitHub
- URL: https://github.com/nisaacson/load-config
- Owner: nisaacson
- Created: 2013-03-17T17:12:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-03-17T17:13:12.000Z (over 11 years ago)
- Last Synced: 2024-09-17T04:38:32.233Z (about 2 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Load Config
Load an nconf configuration by using a file path passed as a command line option# Installation
```bash
npm install load-config
```# Usage
In this example **test/config.json** is a path to the configuration file you wish to load
```bash
cd
node load.js --config test/config.json
```**load.js**
```javascript
var loadConfig = require('load-config')
loadConfig(function(err, config) {
should.not.exist(err, 'error loading config: ' + JSON.stringify(err))
inspect('config loaded')
var role = config.get('role')
inspect(role, 'config role')
})
```