Last active
March 11, 2021 06:57
-
-
Save andrewosh/e64b8c4512eec452810deab5abaa9e4a to your computer and use it in GitHub Desktop.
Hyperbee Pouch Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doesn't create local database file or folder.