No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
index.js
package.json

README.md

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