yiwn-prop

0.0.3 • Public • Published

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

Dependencies (2)

Dev Dependencies (3)

Package Sidebar

Install

npm i yiwn-prop

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • antaranian