# propperty

> Get, set, or delete a property from a nested object using a dot path.

Latest version **1.0.1** (published 2021-02-03) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.1 |
| Published | 2021-02-03 |
| First published | 2021-02-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | gk803 |
| Maintainers | gk803 |
| Keywords | propperty |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2021-02-03
- 1.0.0 — 2021-02-03

## README

# propperty

Set and get values on objects via dot-notation strings.

## Example

```js
var deep = require('propperty');

var obj = {
  foo: {
    bar: 'baz',
    'bar.baz': 'qux'
  }
};

// Get
console.log(deep(obj, 'foo.bar'));
  // => "baz"

// Get with array
console.log(deep(obj, ['foo', 'bar.baz']));
  // => "qux"

// Set
deep(obj, 'foo.bar', 'hello');
console.log(obj.foo.bar);
  // => "hello"

// Set with array
deep(obj, ['foo', 'bar.baz'], 'goodbye');
console.log(obj.foo['bar.baz']);
  // => "goodbye"
```

## API

### deep(object, path[, value])

Where `path` is a dot-notation string `foo.bar` or an array of strings.

- If `value` is passed it will be set on the path.
- Set `deep.p = true` if you want non-existent paths to be initialized.
- If you want to unset (or delete), pass `undefined` as the `value`.

## Installation

With [npm](https://npmjs.org) do:

```bash
npm install propperty
```

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