Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

nconf4policy

0.0.2 • Public • Published

nconf4policy

Installation

$ npm install nconf4policy

Example

var nconf = require('nconf4policy');
// policy priority 'file' > 'overrides' > 'defaults'
 
nconf.overrides({foo:'bar'});
nconf.get('foo');
// bar
 
nconf.defaults({foo:'helloworld'});
nconf.get('foo');
// bar
 
nconf.defaults({foo:'helloworld'});
// throw Error: duplicate configure key.
 
nconf.file({file:'/tmp/nconf.json'});
nconf.set('foo', 'helloworld');
nconf.get('foo');
// helloworld
 
nconf.save();
// { foo: 'helloworld' }

Keywords

Install

npm i nconf4policy

DownloadsWeekly Downloads

1

Version

0.0.2

License

ISC

Last publish

Collaborators

  • avatar