# numeric-id-map

> Data structure that maps entries to numeric ids

Latest version **1.1.0** (published 2015-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install numeric-id-map
pnpm add numeric-id-map
yarn add numeric-id-map
bun add numeric-id-map
```

## 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.1.0 |
| Published | 2015-08-16 |
| First published | 2015-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/numeric-id-map
- Repository: https://github.com/mafintosh/numeric-id-map
- Issues: https://github.com/mafintosh/numeric-id-map/issues
- npm.io page: https://npm.io/package/numeric-id-map

## Recent versions

- 1.1.0 (latest) — 2015-08-16
- 1.0.0 — 2015-08-15

## README

# numeric-id-map

Data structure that maps entries to numeric ids

```
npm install numeric-id-map
```

[![build status](http://img.shields.io/travis/mafintosh/numeric-id-map.svg?style=flat)](http://travis-ci.org/mafintosh/numeric-id-map)

## Usage

``` js
var map = require('numeric-id-map')
var ids = map()

// map an entry to a numeric id
var id = ids.add({hello: 'world'})

// remove an id and get the data back
// the id will be reused for another entry
var entry = map.remove(id)
```

## API

#### `var ids = map()`

Create a new instance

#### `id = ids.add(entry)`

Map an entry to a numberic id.

#### `entry = ids.remove(id)`

Remove an id and return the previously mapped entry.
After removing the id might be reused in the future.

#### `entry = ids.get(id)`

Lookup a mapped entry by it's id without removing it

## License

MIT

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