hyperdb-promise
v1.1.0
Published
Distributed scalable database with a Promise-based API
Downloads
1
Readme
hyperdb-promise
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.