Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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')
})
```