Skip to content

Instantly share code, notes, and snippets.

@kazupon
Created December 6, 2012 16:58
Show Gist options
  • Save kazupon/4226031 to your computer and use it in GitHub Desktop.
Save kazupon/4226031 to your computer and use it in GitHub Desktop.
'use strict';
var log = console.log.bind(console);
var format = require('util').format;
var kv = require('kv')('./kv');
var ps = kv.put('hello/there');
var rnd = Math.random();
ps.write({ hello: rnd });
ps.end();
ps.on('close', function () {
var gs = kv.get('hello/there');
gs.on('data', function (data) {
log('data:', data);
});
});
kv.list().pipe(process.stdout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment