# @ranfdev/deepobj

> get, set, delete deep objects in javascript. Get the last object reference

Latest version **1.0.4** (published 2026-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ranfdev/deepobj
pnpm add @ranfdev/deepobj
yarn add @ranfdev/deepobj
bun add @ranfdev/deepobj
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2026-05-09 |
| First published | 2018-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ranfdev |
| Maintainers | ranfdev |

## Links

- npm: https://www.npmjs.com/package/@ranfdev/deepobj
- npm.io page: https://npm.io/package/@ranfdev/deepobj

## Recent versions

- 1.0.4 (latest) — 2026-05-09
- 1.0.3 — 2026-05-09
- 1.0.2 — 2018-05-07
- 1.0.1 — 2018-05-07
- 1.0.0 — 2018-04-03

## README

# deepobj(action, obj, path)

Get, set, delete or do what you want with a deep object (it keeps the object reference).
inspired from [dlv](https://github.com/developit/dlv) and [dset](https://github.com/lukeed/dset/)

# Install:
```npm i @ranfdev/deepobj```

## Examples:

```
import deepobj from "@ranfdev/deepobj"
const objectToTest = {a: {b: {c: {d: 2}}}}


// define some basic actions

const get = (obj, prop) => obj[prop];
const set = n => (obj, prop) => (obj[prop] = n);

// You can do what you want, even deleting the nested object
const del = (obj, prop) => delete obj[prop];

// use them
deepobj(get, objectToTest, 'a.b.c.d') // 2
deepobj(set(10), objectToTest, 'e.f.g')

console.log(objectToTest.e.f.g) //10
```

## Why i made this

dlv only returns the value of the nested object. I needed a way to get the reference of the nested object

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