node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

getsetmixin

getsetmixin

Simple map like mixin for objects. This was designed to emulate the behaviour of express configuration methods (.get, .set).

Usage

var object = { xxx: true };
 
require('getsetmixin')(object);
 
// no conflicts 
object.get('xxx'); // => undefined 
 
// chainable 
object.set('xxx', 1).
       set('yyy', 2);
 
object.get('xxx'); // => 1 
object.get('yyy'); // => 2