Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josudoey/nconf4policy
define configure value policy for nconf
https://github.com/josudoey/nconf4policy
Last synced: about 1 month ago
JSON representation
define configure value policy for nconf
- Host: GitHub
- URL: https://github.com/josudoey/nconf4policy
- Owner: josudoey
- Created: 2017-02-07T09:49:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-11T15:20:07.000Z (almost 8 years ago)
- Last Synced: 2024-11-30T15:58:01.515Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# nconf4policy
## Installation
```bash
$ npm install nconf4policy
```## Example
```js
var nconf = require('nconf4policy');
// policy priority 'file' > 'overrides' > 'defaults'nconf.overrides({foo:'bar'});
nconf.get('foo');
// barnconf.defaults({foo:'helloworld'});
nconf.get('foo');
// barnconf.defaults({foo:'helloworld'});
// throw Error: duplicate configure key.nconf.file({file:'/tmp/nconf.json'});
nconf.set('foo', 'helloworld');
nconf.get('foo');
// helloworldnconf.save();
// { foo: 'helloworld' }
```