# dent

> The closest you can get to DEstructuring assignmeNT with good old ES5's objects and functions

Latest version **0.2.0** (published 2014-11-10) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2014-11-10 |
| First published | 2014-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Eugene Sharygin |
| Maintainers | eush77 |
| Keywords | destructive, destructuring, assignment, destructure, object, array, pseudoarray, collection, index, cache, es6, es5, shim |

## Links

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

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2014-11-10
- 0.1.1 — 2014-11-10
- 0.1.0 — 2014-11-09

## README

# dent [![Dependency Status][david-badge]][david] [![DevDependency Status][david-dev-badge]][david-dev]

[![npm](https://nodei.co/npm/dent.png)](https://nodei.co/npm/dent/)

[david-badge]: https://david-dm.org/eush77/dent.png
[david]: https://david-dm.org/eush77/dent
[david-dev-badge]: https://david-dm.org/eush77/dent/dev-status.png
[david-dev]: https://david-dm.org/eush77/dent#info=devDependencies

The closest you can get to DEstructuring assignmeNT with good old ES5's objects and functions.

## Example

`dent` for arrays:

```js
> var tuple = ['first', 'second', 'third']

> dent(tuple)
> var a = dent() // Or in a single statement: dent(tuple)()
> var b = dent()
> var c = dent()

> dent.idx
3 // Next element's index.

> [a, b, c]
[ 'first', 'second', 'third' ]
```

`dent` for objects:

```js
> var pair = { first: 'foo', second: 'bar' }

> dent(pair)
> var a = dent.o.first // Or in a single statement: dent(pair).o.first
> var b = dent.o.second

> [a, b]
[ 'foo', 'bar' ]
```

## API

### dent(obj)

Save reference to `obj` in `dent.o`. Return the `dent` itself.

### dent.o

Object passed to `dent` the last time.

### dent()

Return the next element (with index `dent.idx`) and increment `dent.idx` by 1.

### dent.idx

Next element's index (as would be accessed by `dent()`).

## Warning

`dent` storage is **temporary**. Drop your object in, take it apart, but don't assume that it will sit in `dent.o` or `dent.idx` will be the same next time you check.

## Install

```shell
npm install dent
```

## License

MIT

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