yiwn-prop
v0.0.3
Published
Get or set properties of object.
Downloads
3
Readme
prop
Set or get properties of provided object.
Installation
Using component
$ component install yiwn/prop
Using npm for browserify
$ npm install yiwn-prop
Usage
Example:
var prop = require('yiwn-prop');
var obj = {
a: 0,
c: 'Shakira'
};
prop(obj, 'c'); // -> 'Shakira'
prop(obj, 'c', 'Britney'); // { a: 0, c: 'Britney' }
prop(obj, { a: 50, b: [1, 2] }); // { a: 50, b: [1, 2], c: 'Britney' }
Test
Run tests with mocha
$ make test
License
The MIT License