Skip to content

Instantly share code, notes, and snippets.

@hackergrrl
Created May 12, 2018 23:06
Show Gist options
  • Save hackergrrl/88a18d41efa0f13c2bce1e50fe7e485f to your computer and use it in GitHub Desktop.
Save hackergrrl/88a18d41efa0f13c2bce1e50fe7e485f to your computer and use it in GitHub Desktop.
var ram = require('random-access-memory')
var hyperdb = require('hyperdb')
var alice = hyperdb(ram, { valueEncoding: 'json' })
alice.put('foo/bar', 'baz', function () {
alice.put('foo/2', { some: 'json' }, function () {
var bob = hyperdb(ram, alice.key, { valueEncoding: 'json' })
bob.ready(function () {
alice.authorize(bob.local.key, function () {
bob.put('a/b', 12, function () {
alice.put('foo/hup', 'beep', function () {
})
})
})
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment