# orbit-db-storage-adapter

> OrbitDB adapter for any abstract-leveldown compliant storage

Latest version **0.9.0** (published 2023-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install orbit-db-storage-adapter
pnpm add orbit-db-storage-adapter
yarn add orbit-db-storage-adapter
bun add orbit-db-storage-adapter
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2023-01-17 |
| First published | 2019-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 97.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | hajamark |
| Maintainers | hajamark |
| Keywords | leveldown, levelup, orbitdb |

## Links

- npm: https://www.npmjs.com/package/orbit-db-storage-adapter
- Repository: https://github.com/orbitdb/orbit-db-storage-adapter
- Homepage: https://github.com/orbitdb/orbit-db-storage-adapter#readme
- Issues: https://github.com/orbitdb/orbit-db-storage-adapter/issues
- npm.io page: https://npm.io/package/orbit-db-storage-adapter

## Dependencies (2)

- [level](https://npm.io/package/level.md) ^8.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^2.1.1

## Recent versions

- 0.9.0 (latest) — 2023-01-17
- 0.9.1-de44df3.0 (next) — 2023-01-17
- 0.8.1-7b7166d.0 — 2023-01-17
- 0.8.1-fc61eed.0 — 2023-01-08
- 0.8.1-722584e.0 — 2023-01-08
- 0.8.1-5529efb.0 — 2023-01-08
- 0.8.1-75dc731.0 — 2022-08-23
- 0.8.0 — 2022-08-23
- 0.7.0 — 2022-08-21
- 0.6.0 — 2021-05-25
- 0.5.3 — 2019-09-10
- 0.5.2 — 2019-09-05
- 0.5.1 — 2019-09-05
- 0.5.0 — 2019-09-01
- 0.4.2 — 2019-06-07
- … 5 more at https://npm.io/package/orbit-db-storage-adapter/versions

## README

# OrbitDB Storage Adapter

[![CircleCI](https://circleci.com/gh/orbitdb/orbit-db-storage-adapter/tree/master.svg?style=svg)](https://circleci.com/gh/orbitdb/orbit-db-storage-adapter/tree/master) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/orbitdb/Lobby) [![Matrix](https://img.shields.io/badge/matrix-%23orbitdb%3Apermaweb.io-blue.svg)](https://riot.permaweb.io/#/room/#orbitdb:permaweb.io) 

> A wrapper for abstract-leveldown compliant stores, used by OrbitDB

This is a tool that manages a persistent connection to an [`abstract-leveldown`](https://github.com/Level/abstract-leveldown) compliant store. The implementation tests indicate include examples for the following stores

- **[`leveldown`](https://github.com/Level/leveldown)**
- **[`memdown`](https://github.com/Level/memdown)**
- **[`level-js`](https://github.com/Level/level.js)**

[Help is wanted](https://github.com/orbitdb/orbit-db-storage-adapter/issues/3) to support more stores!

OrbitDB uses it primarily with levelup (in node.js) and level-js (in the browser) and inside the orbit-db-keystore and orbit-db-cache packages.

## Install

Leveldown is used as an example here, but you could install any abstract-leveldown complaint store.

```JavaScript
npm install orbit-db-storage-adapter leveldown
```

## Usage

Usage is the same on the command line or in the browser. `async`/`await` used for brevity.

```JavaScript
// Requirements
import leveldown from 'leveldown' // or any abstract-leveldown complaint store
import storageAdapter from 'orbit-db-storage-adapter')

const leveldownOptions = {}
const storage = storageAdapter(leveldown, leveldownOptions)

const levelupOptions = {} // see below
store = await storage.createStore(location, levelupOptions) // These options passed to levelup instance
// ***
// Do stuff with the store here: get, put, delete, batch, etc
// **
await store.close()
await storage.destroy(store)
```

### Options

When setting everything up, you have the opportunity to pass two sets of options: one for the `leveldown` instantiation, and the other for the `levelup` instantiation.

## Contributing

Pull requests and issues are welcome. Issues tagged with "[Help Wanted](https://github.com/orbitdb/orbit-db-storage-adapter/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted")" will have the most impact.

## License 

[MIT](LICENSE) © Haja Networks Oy

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