Publish Nerbus source snapshot and build documentation

This commit is contained in:
Nerbus Contributors committed 2026-10-17 18:56:29 +00:00
commit 76cccceca7
198 files changed
+338574

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
var rpc = require('./jsonrpc');
function Client(opts) {
this.rpc = new rpc.Client(opts);
};
Client.prototype.cmd = function() {
var args = [].slice.call(arguments);
var cmd = args.shift();
callRpc(cmd, args, this.rpc);
};
function callRpc (cmd, args, rpc) {
var fn = args[args.length - 1];
// if the last argument is a callback, pop it from the args list
if (typeof fn === 'function')
args.pop();
else
fn = function () {};
rpc.call(cmd, args, function () {
var args = [].slice.call(arguments);
args.unshift(null);
fn.apply(this, args);
}, function(err) {
fn(err);
});
};
module.exports.Client = Client;