pluck
v0.0.4
Published
pluck values from an object path
Downloads
11,509
Readme
pluck
pluck property path from arrays or an object.
Installation
component
$ component install redventures/pluck
or
npm
$ npm install pluck
Example
Pluck from arrays.
var pluck = require('pluck');
var firstName = pluck('name.first');
var items = [
{ name: { first: 'john', last: 'doe' } }
];
var names = firstName(items);
Pluck from simple objects.
var pluck = require('pluck');
var item = {
name: {
first: 'john',
last: 'doe'
}
};
var name = firstName(item);
API
pluck(path)
Creates the property lookup function.
License
MIT