mutators

0.2.0 • Public • Published

Mutators

Mixin for get/set object mutator behavior

Useage

var extend = require('extend');
var Mutators = require('mutators');
 
// creates object with get/set functions
var person = extend({}, Mutators);
 
// set an object attribute
person.set('name', 'bill');
 
// get an object attribute
log(person.get('name'))

Methods

Methods are defined with the expectation that they will be extended into an instance or prototype of an object. They won't work as static functions.

get(property)

Returns the value of object property.

person.get('name')

set(property, value)

Defines a key-value pair on context object. Multiple key-value pairs can be defined by passing an object.

person.set('name', 'bill');

Keywords

none

install

npm i mutators

Downloadsweekly downloads

9

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability