0.0.4 • Published 11 years ago

pluck v0.0.4

Weekly downloads
1,276
License
-
Repository
-
Last release
11 years ago

Build Status

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