# pick-deep

> Creates an object composed of the picked object properties from a nested object using a dot path or custom separator

Latest version **1.0.0** (published 2018-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install pick-deep
pnpm add pick-deep
yarn add pick-deep
bun add pick-deep
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-03-19 |
| First published | 2018-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/pick-deep) |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Alexey Bystrov |
| Maintainers | strikeentco |
| Keywords | obj, object, prop, property, dot, path, pick, deep, pickDeep, pick-deep, access, notation, dotty, key, nested, paths, properties, props, segment, value, values, custom, separator, small, fast |

## Links

- npm: https://www.npmjs.com/package/pick-deep
- Repository: https://github.com/strikeentco/pick-deep
- Homepage: https://github.com/strikeentco/pick-deep#readme
- Issues: https://github.com/strikeentco/pick-deep/issues
- npm.io page: https://npm.io/package/pick-deep

## Dependencies (2)

- [@strikeentco/get](https://npm.io/package/@strikeentco/get.md) ^1.0.0
- [@strikeentco/set](https://npm.io/package/@strikeentco/set.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-03-19

## README

pick-deep [![License](https://img.shields.io/npm/l/pick-deep.svg)](https://github.com/strikeentco/pick-deep/blob/master/LICENSE)  [![npm](https://img.shields.io/npm/v/pick-deep.svg)](https://www.npmjs.com/package/pick-deep)
==========
[![Build Status](https://travis-ci.org/strikeentco/pick-deep.svg)](https://travis-ci.org/strikeentco/pick-deep)  [![node](https://img.shields.io/node/v/pick-deep.svg)](https://www.npmjs.com/package/pick-deep) [![Test Coverage](https://api.codeclimate.com/v1/badges/b30a2d27d1f5f1e5507a/test_coverage)](https://codeclimate.com/github/strikeentco/pick-deep/test_coverage) [![bitHound Score](https://www.bithound.io/github/strikeentco/pick-deep/badges/score.svg)](https://www.bithound.io/github/strikeentco/pick-deep)

One of the smallest (*28 sloc*) and most effective implementations of object properties deep picking.

# Usage

```sh
$ npm install pick-deep --save
```

```javascript
const pick = require('pick-deep');

pick({ a: { b: ['c', 'd'], e: 'f' } }, 'a.b');
pick({ a: { b: ['c', 'd'], e: 'f' } }, ['a.b']);
pick({ a: { b: ['c', 'd'], e: 'f' } }, [['a', 'b']]);
//=> { a: { b: ['c', 'd'] } }

pick({ a: { b: ['c', 'd'], e: 'f' }, j: { k: 'l' }, q: { r: ['s', 't'], u: 'w' }}, [['a', 'b'], 'j', 'q.u']);
//=> { a: { b: ['c', 'd'] }, j: { k: 'l' }, q: { u: 'w' }}

pick({ a: { b: 'c' } }, 'a.b.c.d');
//=> {}

pick({ a: { b: 'c' } }, 'a:b', ':');
//=> { a: { b: 'c' } }
```
## API

### pick(obj, paths, [separator])

#### Params:
* **obj** (*Object*) - Source object.
* **paths** (*String|Array|Array of Arrays*) - String, array or array of arrays with paths.
* **[separator]** (*String*) - `.` by default.

## Related

- [@strikeentco/get](https://github.com/strikeentco/get) - One of the smallest and most effective implementations of getting a nested value from an object.
- [@strikeentco/set](https://github.com/strikeentco/set) - One of the smallest and most effective implementations of setting a nested value on an object.

## License

The MIT License (MIT)<br/>
Copyright (c) 2018 Alexey Bystrov

---
_Source: https://npm.io/package/pick-deep · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
