Skip to content

stringparser/utils-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version

utils-config

lazy object maintenance

install

$ npm install utils-config

usage

var config = require('utils-config');
var proto = {};
var init = {
  hey : 'want something'
}

proto.config = config(init);
proto.config();
// { hey : 'want something'}

proto.config('hey', 'not any more');
// 'not any more'

proto.config().hey = 'come on!'
// 'come on!'

proto.config();
// { hey : 'not any more'}

var clone = proto.config({ clone : true });
var fork  = proto.config({ fork : true });

fork('hey', 'ok, continue');
// 'ok, continue'
fork('hey');
// 'ok, continue'

proto.config();
// { hey : 'ok, continue' }

clone();
// { hey : 'not anymore' }

license

LICENSE

About

lazy object maintenance

Resources

License

Stars

Watchers

Forks

Packages

No packages published