UNPKG

rpc-stream

Version:

very simple rpc. use with any thing that has .pipe()

17 lines (13 loc) 296 B
var rpc = require('../') var test = require('tape') test('single arg', function (t) { t.plan(2) var b = rpc() b.pipe(rpc({ hello: function (cb) { cb(null, 'hello') } })).pipe(b) b.createRemoteCall('hello')(function (err, str) { t.notOk(err) t.equal(str, 'hello') }) })