# sublevel

> sublevels for levelup

Latest version **2.4.0** (published 2014-01-10) · MIT license · 0 weekly downloads

## Install

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

## 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.4.0 |
| Published | 2014-01-10 |
| First published | 2013-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | stagas |
| Maintainers | stagas |
| Keywords | level, leveldb, sublevel |

## Links

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

## Dependencies (3)

- [xtend](https://npm.io/package/xtend.md) ~2.1.1
- [through](https://npm.io/package/through.md) ~2.3.4
- [level-fix-range](https://npm.io/package/level-fix-range.md) ~2.0.0

## Recent versions

- 2.4.0 (latest) — 2014-01-10
- 2.3.0 — 2013-12-07
- 2.2.1 — 2013-12-05
- 2.2.0 — 2013-12-02
- 2.1.0 — 2013-11-30
- 2.0.0 — 2013-11-21
- 1.0.0 — 2013-11-21
- 0.3.1 — 2013-11-19
- 0.3.0 — 2013-11-19
- 0.2.0 — 2013-11-19
- 0.1.0 — 2013-11-19
- 0.0.3 — 2013-11-19
- 0.0.2 — 2013-11-19
- 0.0.1 — 2013-11-19

## README

# sublevel

sublevels for levelup

## Installation

`npm install sublevel`

## Example

```js
var level = require('level');
var sublevel = require('sublevel');

// create a sublevel by passing a level `db` instance
var db = level('/tmp/level');
var items = sublevel(db, 'items');

items.put('foo', 'bar', function(err){
  items.get('foo', function(err, data){
    console.log(data); // => 'bar'
  });
});

// create deeper sublevels by passing the parent
var posts = sublevel(items, 'posts');

// or alternatively by calling `.sublevel()`
var comments = posts.sublevel('comments');
```

## API

The following methods are compatible with a `level` db:

`put`, `get`, `del`, `batch`, `createReadStream`, `createKeyStream`, `createValueStream`, `createWriteStream`

### Sub(db[, path][, options])

Creates a new sublevel under `db`.

### Sub#sublevel(path[, options])

Creates a new sublevel under this.

## License

MIT

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