pluck

pluck values from an object path

pluck

pluck property path from arrays or an object.

component

  $ component install redventures/pluck

or

npm

  $ npm install pluck

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);

Creates the property lookup function.

MIT