PouchDB adapter for p2p data with hyperbee
npm install pouchdb-adapter-hyperbeeAdapter for PouchDB to load p2p data from Hyperbee
``JavaScript
PouchDB.plugin(require('poouchdb-adapter-hyperbee')())
// You can pass any valid hyper:// URLname
// URLs with a in them will generate a local hyperbeehyper://
// You can sparsely load remote DBs with a full URL
const pouch = new PouchDB('hyper://example', {
adapter: 'hyperbee'
})
// Wait for the DB to open if you want to access the bee directly
pouch.once('open', () => {
const url = await pouch.getURL()
// In case you want to access the hyperbee instance directly
const bee = pouch.bee
})
``