# level-fix-range

> make using levelup reverse ranges easy

Latest version **2.0.0** (published 2013-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install level-fix-range
pnpm add level-fix-range
yarn add level-fix-range
bun add level-fix-range
```

## 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 | 2.0.0 |
| Published | 2013-07-29 |
| First published | 2013-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/level-fix-range
- Repository: https://github.com/dominictarr/level-fix-range
- Issues: https://github.com/dominictarr/level-fix-range/issues
- npm.io page: https://npm.io/package/level-fix-range

## Dependencies (1)

- [clone](https://npm.io/package/clone.md) ~0.1.9

## Recent versions

- 2.0.0 (latest) — 2013-07-29
- 1.1.4 — 2013-07-29
- 1.1.3 — 2013-07-26
- 1.1.2 — 2013-04-05
- 1.1.1 — 2013-04-04
- 1.1.0 — 2013-04-03
- 1.0.2 — 2013-03-26
- 1.0.1 — 2013-03-26
- 1.0.0 — 2013-03-26

## README

# level-fix-range

make reverse ranges easier to use.

## Stability

Stable: Expect patches, possible features additions.

## Example

When you use reverse ranges, you have to reverse the `start` and `end` also,

``` js
db.createReadStream({start: 'a', end: 'z'})
db.createReadStream({start: 'z', end: 'a', reverse: true})
```

this is confusing and bug-ridden.

level-fix-range fixes the options so they always make sense.
if you want a range to reverse, just set reverse.

``` js
var fix = require('level-fix-range')
db.createReadStream({start: 'a', end: 'z'})
db.createReadStream(fix({start: 'a', end: 'z', reverse: true}))
```

When you either `start` _OR_ `end`, and the order is `reversed: true`,
it will also reverse the range,
so that:

``` js
{start: X, end: null} //from X to end of database
{start: null, end: X} //from start of database to X
```
and you will get the some data, whether you have reverse=true|false,
but only the order will change.

## License

MIT

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