Skip to content

jozanza/hyperdb-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

HyperDB but with promises instead of callbacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published