Configuration mixin.
Make something configurable:
var Configurable = require('configurable');
// plain obj
var obj = {};
Configurable(obj);
// returns the obj itself
var obj = Configurable({});
// make a prototype configurable
Configurable(MyThing.prototype);The object will then have the following methods available:
.get(name)
.set(name, val)
.set(obj)
.enable(name)
.disable(name)
.enabled(name)
.disabled(name)NOTE: when assigning to a .prototype make sure to re-define .settings = {}
in the constructor so objects do not share these values.