# orbit-db-kvstore

> Key-Value Store for orbit-db

Latest version **2.0.0** (published 2023-01-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install orbit-db-kvstore
pnpm add orbit-db-kvstore
yarn add orbit-db-kvstore
bun add orbit-db-kvstore
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-01-18 |
| First published | 2016-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Haad |
| Maintainers | haad, shamb0t, hajamark |
| Keywords | orbit-db, orbitdb, kv, key-value, kv-store |

## Links

- npm: https://www.npmjs.com/package/orbit-db-kvstore
- Repository: https://github.com/orbitdb/orbit-db-kvstore
- Issues: https://github.com/orbitdb/orbit-db-kvstore/issues
- npm.io page: https://npm.io/package/orbit-db-kvstore

## Recent versions

- 2.0.0 (latest) — 2023-01-18
- 2.0.1-bfda8eb.0 (next) — 2023-01-18
- 1.12.1-e4eee56.0 — 2023-01-11
- 1.12.0 — 2020-09-16
- 1.11.0 — 2020-09-11
- 1.10.0 — 2020-09-06
- 1.9.0 — 2020-05-12
- 1.8.0 — 2020-03-10
- 1.7.0 — 2019-12-05
- 1.6.0 — 2019-10-03
- 1.6.0-rc1 — 2019-08-30
- 1.5.1 — 2019-05-06
- 1.4.1 — 2019-05-06
- 1.5.0 — 2019-05-03
- 1.5.0-rc4 — 2019-04-29
- … 33 more at https://npm.io/package/orbit-db-kvstore/versions

## README

# orbit-db-kvstore

[![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) 
[![npm version](https://badge.fury.io/js/orbit-db-kvstore.svg)](https://badge.fury.io/js/orbit-db-kvstore)

> Key-Value database for orbit-db

A key-value database just like your favourite key-value database.

Used in [orbit-db](https://github.com/haadcode/orbit-db).

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Contributing](#contributing)
- [License](#license)

## Install
```
npm install orbit-db ipfs
```

## Usage

First, create an instance of OrbitDB:

```javascript
import * as IPFS from 'ipfs'
import OrbitDB from 'orbit-db'

const ipfs = new IPFS()
const orbitdb = await OrbitDB.createInstance(ipfs)
```

Get a key-value database and add an entry to it:

```javascript
const kv = await orbitdb.kvstore('settings')
kv.put('volume', '100')
  .then(() => {
    console.log(kv.get('volume'))
    // 100
  })
```

Later, when the database contains data, load the history and query when ready:

```javascript
const kv = await orbitdb.kvstore('settings')
kv.events.on('ready', () => {
  console.log(kv.get('volume'))
  // 100
})
```

## API

See [orbit-db's API Documentation](https://github.com/haadcode/orbit-db/blob/master/API.md#kvstorename) for full details.

## Contributing

If you think this could be better, please [open an issue](https://github.com/orbitdb/orbit-db-kvstore/issues/new)!

Please note that all interactions in [@orbitdb](https://github.com/orbitdb) fall under our [Code of Conduct](CODE_OF_CONDUCT.md).

## License

[MIT](LICENSE) ©️ 2016-2018 Protocol Labs Inc., 2018 Haja Networks Oy

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