config-obj

Make object(class) configurable

npm install config-obj
11 downloads in the last day
68 downloads in the last week
255 downloads in the last month

node-config-obj

Make object or class configurable.

Usage

var configurable = require('config-obj');

var MyClass = function() {

};

MyClass.prototype.mainJob = function() {
    // do something

    // call the endSession method so that you can use session style configuration
    this.endSession(); 
}

configurable(MyClass);

var myInstance = new MyClass();
myInstance.option({
    option1: 'option1',
    option2: 'option2',
    //... 
});
myInstance.getOption('option1');

myInstance.session('option1', 'this value will only be applied only once').mainJob();

Installation

Install it via npm:

npm install config-obj
npm loves you