# deepval

> get and set object values using dot-delimited key strings

Latest version **4.0.0** (published 2018-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install deepval
pnpm add deepval
yarn add deepval
bun add deepval
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2018-02-08 |
| First published | 2013-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Matthew Hadley |
| Maintainers | diffsky |
| Keywords | config, object, string, keys, dot, notation |

## Links

- npm: https://www.npmjs.com/package/deepval
- Repository: https://github.com/diffsky/deepval
- Homepage: https://github.com/diffsky/deepval#readme
- Issues: https://github.com/diffsky/deepval/issues
- npm.io page: https://npm.io/package/deepval

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2018-02-08
- 3.0.0 — 2017-12-19
- 2.3.0 — 2017-04-25
- 2.2.0 — 2017-01-03
- 2.1.0 — 2016-05-10
- 2.0.0 — 2015-08-05
- 1.1.6 — 2015-07-16
- 1.1.5 — 2014-11-16
- 1.1.4 — 2014-07-19
- 1.1.3 — 2014-05-20
- 1.1.2 — 2014-05-19
- 1.1.1 — 2014-05-19
- 1.1.0 — 2014-05-19
- 1.0.1 — 2014-05-17
- 1.0.0 — 2014-04-24
- … 5 more at https://npm.io/package/deepval/versions

## README

# deepval [![](https://travis-ci.org/diffsky/deepval.svg)](https://travis-ci.org/diffsky/deepval)

Get, Set and Remove object values using dot-delimited key strings

```
deepval(<object to inspect>, <string path> or <array of string keys>, [value to set], [boolean: remove])
```

or:
```
deepval.get(obj, path);
deepval.set(obj, path, value);
deepval.del(obj, path);
```

examples:
```
var obj = {
  a: {
    b: {
      c: 'deep'
    },
    d: ['foo'],
    e: ['bar', ['aaa', 'bbb']]
  }
};

// get a value
console.log(deepval(obj, 'a.b.c'));   // 'deep'
// set a value
deepval(obj, 'a.b.c', 'something');
console.log(deepval(obj, 'a.b.c'));   // 'something'
// remove a value
deepval(obj, 'a.b.c', null, true);
console.log(deepval(obj, 'a.b.c'));   // undefined
// read array values
console.log(deepval(obj, 'a.d.0'));   // 'foo'
console.log(deepval(obj, ['a', 'd', 0]));   // 'foo'
console.log(deepval(obj, 'a.e.1.0')); // 'aaa'
```

deepval provides a utility function `dotpath` to create a dot-delimited string
from a set of passed arguments:
```
console.log(deepval.dotpath('hello', a.b.0))  //  'hello.foo'
```

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