# dref

> deep object refs

Latest version **0.1.2** (published 2013-08-13) · 0 weekly downloads

## Install

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

## Health

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

Warnings: low downloads; no types; no esm support; has vulnerabilities; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2013-08-13 |
| First published | 2012-04-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 1 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Craig Condon |
| Maintainers | architectd |

## Links

- npm: https://www.npmjs.com/package/dref
- Repository: https://github.com/crcn/dref.js
- npm.io page: https://npm.io/package/dref

## Dependencies (3)

- [dref](https://npm.io/package/dref.md) 0.0.x
- [structr](https://npm.io/package/structr.md) 0.2.x
- [type-component](https://npm.io/package/type-component.md) 0.0.x

## Recent versions

- 0.1.2 (latest) — 2013-08-13
- 0.1.1 — 2013-08-13
- 0.1.0 — 2013-08-12
- 0.0.6 — 2013-04-21
- 0.0.5 — 2013-03-22
- 0.0.4 — 2013-03-18
- 0.0.3 — 2013-03-15
- 0.0.2 — 2012-11-30
- 0.0.1 — 2012-10-30
- 0.0.0 — 2012-04-30

## README

### Features

- Ability to deep reference an object
- Ability to scan arrays, and return an array of values, e.g, `users.$.name`.


### Usage

```javascript

var dref = require("dref");

var target = [
	{
		name: "Craig", 
		location: {
			city: "minneapolis"
		}
	},
	{
		name: "Tim", 
		location: {
			city: "St. Paul"
		}
	}
];


console.log(dref.get(target, '$.name')); //["Craig", "Tim"]
console.log(dref.get(target, '$.location.city')); //["Minneapolis", "St. Paul"]
dref.set(target, '$.name', "BLAH");
console.log(dref.get(target, '$.name')); //["BLAH", "BLAH"]
```

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