multileveled

Expose a leveled db over the network

multileveled

Expose a leveled db over the network.

Synchronous methods are not exposed.

var multileveled = require('multileveled');
 
var leveled = require('leveled');
var _db = leveled(__dirname + '/db');
 
var net = require('net');
net.createServer(function (c) {
  c.pipe(multileveled.server(_db)).pipe(c);
}).listen(9898);
 
var db = multileveled.client();
db.pipe(net.connect(9898)).pipe(db);
 
db.put('foo', 'bar', function (err) {
  if (err) throw err;
  db.get('foo', function (errvalue) {
    if (err) throw err;
    assert(value == 'bar');
    console.log('success');
    process.exit(0);
  })
})

Return a stream that is to be piped into client streams.

Return a stream that is to be piped into a server stream.

See leveled.

$ npm install multileveled

MIT