# level-enumerate

> Enumerate keys to incrementing numbers

Latest version **1.0.1** (published 2015-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install level-enumerate
pnpm add level-enumerate
yarn add level-enumerate
bun add level-enumerate
```

## 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 | 2015-02-07 |
| First published | 2015-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/level-enumerate
- Repository: https://github.com/mafintosh/level-enumerate
- Issues: https://github.com/mafintosh/level-enumerate/issues
- npm.io page: https://npm.io/package/level-enumerate

## Dependencies (1)

- [mutexify](https://npm.io/package/mutexify.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2015-02-07
- 1.0.0 — 2015-02-07

## README

# level-enumerate

Enumerate keys to incrementing numbers.
If you enumerate the same key twice it will enumerate to the same value.

```
npm install level-enumerate
```

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

## Usage

``` js
var enumerator = require('level-enumerate')
var enumerate = enumerator(db) // where db is a levelup

enumerate('hello', function (err, value) {
  console.log(value) // prints 0
  enumerate('hello', function (err, value) {
    console.log(value) // prints 0 again
    enumerate('world', function (err, value) {
      console.log(value) // prints 1
    })
  })
})
```

## API

#### `enumerate = enumerator(db, [options])`

Create a new enumerator. Options include

``` js
{
  sep: '!'    // the separator used when storing the key values
  prefix: ... // optional string prefix to use when keys when stored
}
```

## License

MIT

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