Lightweight RPC over IPC for node.js
$ npm i rpc-over-ipc
proc
-ChildProcess
instance orprocess
name
- function namefunc
- asynchronous function to call, last argument should be a callback function that takeserr
andresult
arguments
var rpc = require('rpc-over-ipc');
rpc.register(process, 'add', function(a, b, callback) {
callback(null, a + b);
});
proc
-ChildProcess
instance orprocess
name
- function nameargs
- array the arguments with whichname
function should be called, optionalcallback
- callback function which is called whenname
functions have finished
var rpc = require('rpc-over-ipc');
rpc.call(process, 'add', [1, 2], function(err, result) {
console.log(result);
});