Socket
Socket
Sign inDemoInstall

orbit-db-kvstore

Package Overview
Dependencies
0
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    orbit-db-kvstore

Key-Value Store for orbit-db


Version published
Weekly downloads
319
increased by23.17%
Maintainers
3
Install size
10.0 kB
Created
Weekly downloads
 

Readme

Source

orbit-db-kvstore

Gitter Matrix npm version

Key-Value database for orbit-db

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

Used in orbit-db.

Table of Contents

Install

npm install orbit-db ipfs

Usage

First, create an instance of OrbitDB:

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:

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:

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

API

See orbit-db's API Documentation for full details.

Contributing

If you think this could be better, please open an issue!

Please note that all interactions in @orbitdb fall under our Code of Conduct.

License

MIT ©️ 2016-2018 Protocol Labs Inc., 2018 Haja Networks Oy

Keywords

FAQs

Last updated on 18 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc