Skip to content

Instantly share code, notes, and snippets.

@datafatmunger
Last active June 25, 2018 11:41
Show Gist options
  • Select an option

  • Save datafatmunger/cbbeb1dcc030d88cf9570cf02175f78a to your computer and use it in GitHub Desktop.

Select an option

Save datafatmunger/cbbeb1dcc030d88cf9570cf02175f78a to your computer and use it in GitHub Desktop.
var crypto = require('crypto'),
hyperdb = require('hyperdb'),
cms = require('random-access-idb')('cms')('cms.txt');
var db = hyperdb((filename) => {
return cms;
});
db.put("hello", "world", (err) => {
if(err) throw err;
db.get("hello", (err, nodes) => {
if(err) throw err;
console.log(JSON.stringify(nodes));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment