# dig-it

> "Dig" into nested data structures in order to aggregate or set values at an object "path"

Latest version **0.1.1** (published 2014-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install dig-it
pnpm add dig-it
yarn add dig-it
bun add dig-it
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-07-31 |
| First published | 2014-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Philip Allen |
| Maintainers | squirkle |
| Keywords | pluck, deep |

## Links

- npm: https://www.npmjs.com/package/dig-it
- Repository: https://github.com/squirkle/dig-it
- Issues: https://github.com/squirkle/dig-it/issues
- npm.io page: https://npm.io/package/dig-it

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^2.4.1

## Recent versions

- 0.1.1 (latest) — 2014-07-31
- 0.1.0 — 2014-07-31
- 0.0.1 — 2014-07-30

## README

# dig-it [![Build Status](https://travis-ci.org/squirkle/dig-it.svg?branch=master)](https://travis-ci.org/squirkle/dig-it)

A simple utility for getting/setting values on nested data structures.  If you are familiar with Lodash's "pluck" method, this is similar, but for nested arrays and objects.

```javascript
var data = {
  foos: [{
    bars: [{
      id: 123
    }, {
      id: 234
    }]
  }]
};
var ids = dig(data).get('foos.bars.id'); // ids is [123, 234]
```

There is also a facility for setting data at nested paths:
```javascript
var data = {
  foos: [{
    bars: [{
      id: 123,
      name: 'bing'
    }, {
      id: 234,
      name: 'blam'
    }]
  }]
};
dig(data).set('foos.bars', function (bars) {
  return dig(bars).get('id');
});
// 'bars' properties in data.foos now contain arrays of bar ids
```

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