Skip to content

Instantly share code, notes, and snippets.

@andrewosh
Last active March 11, 2021 06:57
Show Gist options
  • Save andrewosh/e64b8c4512eec452810deab5abaa9e4a to your computer and use it in GitHub Desktop.
Save andrewosh/e64b8c4512eec452810deab5abaa9e4a to your computer and use it in GitHub Desktop.
Hyperbee Pouch Example
const ram = require('random-access-memory')
const hypercore = require('hypercore')
const HyperBee = require('hyperbee')
const HyperBeeDown = require('hyperbeedown')
const PouchDB = require('pouchdb')
start()
async function start () {
const core = hypercore(ram)
const tree = new HyperBee(core)
const db = new PouchDB('mydatabase', {
db: () => new HyperBeeDown(tree)
})
await db.put({ _id: '1', hello: 'world' })
const doc = await db.get('1')
console.log('doc:', doc)
}
@Lightnet
Copy link

doesn't create local database file or folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment