# object-path-resolve

> Utility function to resolve object paths

Latest version **1.0.6** (published 2018-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-path-resolve
pnpm add object-path-resolve
yarn add object-path-resolve
bun add object-path-resolve
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-06-14 |
| First published | 2018-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 148.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | John Sylvain |
| Maintainers | johnsylvain |

## Links

- npm: https://www.npmjs.com/package/object-path-resolve
- Repository: https://github.com/johnsylvain/object-path-resolve
- Homepage: https://github.com/johnsylvain/object-path-resolve#readme
- Issues: https://github.com/johnsylvain/object-path-resolve/issues
- npm.io page: https://npm.io/package/object-path-resolve

## Recent versions

- 1.0.6 (latest) — 2018-06-14
- 1.0.5 — 2018-04-15
- 1.0.4 — 2018-01-11
- 1.0.3 — 2018-01-11
- 1.0.2 — 2018-01-11
- 1.0.1 — 2018-01-07
- 1.0.0 — 2018-01-07

## README

# object-path-resolve
> A 200b (gzipped) utility function to resolve object properties with string paths

## API
### `resolve(obj: Object, path: String)`
> Retrieve a value from the `obj` based on the `path` (accepts dot and bracket notation)

## Usage
```js
import resolve from 'object-path-resolve'

const obj = {
  prop: { name: 'John' },
  arr: [
    'one', 'two', 'three'
  ]
}

resolve(obj, 'prop.name') // => 'John'
resolve(obj, 'prop.age') // => undefined
resolve(obj, 'arr[1]') // => 'two'
```

## License
[MIT](https://github.com/johnsylvain/object-path-resolve/blob/master/LICENSE)

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