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

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

Awesome Lists containing this project

README

          

[NPM version](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

[LICENSE](http://opensource.org/licenses/MIT)