hyperdb-promise

1.1.0 • Public • Published

hyperdb-promise

NPM Version

HyperDB but with promises instead of callbacks

npm install hyperdb-promise

Usage

import HyperDB from 'hyperdb-promise'
 
const db = new HyperDB('./my.db', { valueEncoding: 'utf-8' })
 
db.on('ready', async () => {
  await db.put('/hello', 'world')
  const [{ value }] = await db.get('/hello')
  console.log(`/hello --> ${value}`)
})

Basically, any db instance method that previously accepted a callback as a final argument is now promisified.

Visit the the original HyperDB repo to get more familiar with the API.

/hyperdb-promise/

    Package Sidebar

    Install

    npm i hyperdb-promise

    Weekly Downloads

    4

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    1.64 kB

    Total Files

    3

    Last publish

    Collaborators

    • jozanza