Skip to content

drylikov/Configurable.JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

129 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configurable

Configuration mixin.

API

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.

About

Configurable mixin .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors