https://github.com/stringparser/utils-config
lazy object maintenance
https://github.com/stringparser/utils-config
Last synced: 7 months ago
JSON representation
lazy object maintenance
- Host: GitHub
- URL: https://github.com/stringparser/utils-config
- Owner: stringparser
- License: mit
- Created: 2014-09-04T12:48:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-09T11:00:45.000Z (over 11 years ago)
- Last Synced: 2025-02-09T08:16:55.394Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[
](http://www.npmjs.org/package/utils-config)
# utils-config
lazy object maintenance
## install
$ npm install utils-config
## usage
```js
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
[
](http://opensource.org/licenses/MIT)