1 | # object.pick [![NPM version](https://badge.fury.io/js/object.pick.svg)](http://badge.fury.io/js/object.pick)
|
2 |
|
3 | > Returns a filtered copy of an object with only the specified keys, exactly like `pick` from lo-dash / underscore.
|
4 |
|
5 | ## Install
|
6 | #### Install with [npm](npmjs.org):
|
7 |
|
8 | ```bash
|
9 | npm i object.pick --save-dev
|
10 | ```
|
11 |
|
12 | ## benchmarks
|
13 |
|
14 | This is the [fastest implementation](http://jsperf.com/pick-props) I tested. Pull requests welcome!
|
15 |
|
16 | ## Run tests
|
17 |
|
18 | ```bash
|
19 | npm test
|
20 | ```
|
21 |
|
22 | ## Usage
|
23 |
|
24 | ```js
|
25 | var pick = require('object.pick');
|
26 |
|
27 | pick({a: 'a', b: 'b'}, 'a')
|
28 | //=> {a: 'a'}
|
29 |
|
30 | pick({a: 'a', b: 'b', c: 'c'}, ['a', 'b'])
|
31 | //=> {a: 'a', b: 'b'}
|
32 | ```
|
33 |
|
34 | ## Author
|
35 |
|
36 | **Jon Schlinkert**
|
37 |
|
38 | + [github/jonschlinkert](https://github.com/jonschlinkert)
|
39 | + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
40 |
|
41 | ## License
|
42 | Copyright (c) 2014 Jon Schlinkert, contributors.
|
43 | Released under the MIT license
|
44 |
|
45 | ***
|
46 |
|
47 | _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 06, 2014._ |
\ | No newline at end of file |