0.0.3 • Published 10 years ago

yiwn-prop v0.0.3

Weekly downloads
7
License
MIT
Repository
-
Last release
10 years ago

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