Skip to content

Instantly share code, notes, and snippets.

View pfrazee's full-sized avatar

Paul Frazee pfrazee

View GitHub Profile
@pfrazee
pfrazee / DatArchive.dream.js
Last active August 27, 2019 19:58 — forked from RangerMauve/DatArchive.dream.js
Dream DatArchive API for extensions / peers
const archive = await DatArchive.load('someurl')
var fooExt = archive.extension('foo')
// listen to 'foo' messages from all peers
fooExt.addEventListener('message', ({detail}) => {
const {message, peer} = detail
// send to one peer:
await peer.extension('bar').send('Hello World')