# dotprop

> Get property value by dot notation

Latest version **2.0.0** (published 2024-06-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-06-20 |
| First published | 2014-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Dima Yv |
| Keywords | dot-prop, dot, json, property, value, notation, object, get-prop, obj, prop, path, get, access, getprop, ramda.path, dot path |

## Links

- npm: https://www.npmjs.com/package/dotprop
- Repository: https://github.com/dy/dotprop
- Issues: https://github.com/dy/dotprop/issues
- npm.io page: https://npm.io/package/dotprop

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0 (latest) — 2024-06-20
- 1.2.1 — 2020-12-04
- 1.2.0 — 2019-03-29
- 1.1.0 — 2019-03-28
- 1.0.2 — 2015-01-08
- 1.0.1 — 2014-12-14
- 1.0.0 — 2014-12-08

## README

# dotprop [![test](https://github.com/dy/dotprop/actions/workflows/node.js.yml/badge.svg)](https://github.com/dy/dotprop/actions/workflows/node.js.yml)

Get property by dot notation.
A short and dependable implementation.

```js
import getProp from 'dotprop';

getProp({a: { b: { c: 1}} }, 'a.b.c') // 1
getProp([1,2,3], 2) // 3
getProp({}, 'a.b') // undefined

// recognizes arrays too
getProp({a: { b: { c: 1}} }, ['a', 'b', 'c']) // 1
getProp({a: { 'b.c': 1 }}, ['a', 'b.c']) // 1
```

## Similar

* [developit/dlv](https://github.com/developit/dlv) – the most compact alternative.
* [sindresohrus/dot-prop](https://github.com/sindresorhus/dot-prop) - enables escaping `\.` at price of larger codebase.
* [facebookindicator/idx](https://github.com/facebookincubator/idx)

[![NPM](https://nodei.co/npm/dotprop.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/dotprop/)

<p align=center><a href="https://github.com/krishnized/license/">🕉</a></p>

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