Socket
Socket
Sign inDemoInstall

dnode

Package Overview
Dependencies
Maintainers
0
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnode - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

19

lib/dnode.js

@@ -193,21 +193,2 @@ var net = require('net');

// wrapper to turn synchronous functions into asynchronous ones with the
// result callback inserted as the last argument
DNode.sync = function (f) {
return function () {
var args = [].concat.apply([],arguments);
var argv = args.slice(0,-1);
var cb = args.slice(-1)[0];
cb(f.apply(this,argv));
};
};
// Expose prototype methods so DNode can get at them
DNode.expose = function (obj, name) {
obj[name] = function () {
var args = [].slice.call(arguments);
return obj.constructor.prototype[name].apply(obj, args);
};
};
function parseArgs (argv) {

@@ -214,0 +195,0 @@ var params = {};

2

package.json
{
"name" : "dnode",
"version" : "0.5.1",
"version" : "0.5.2",
"description" : "Call remote methods and callbacks with a JSON-based protocol. RMI for network sockets and the browser too!",

@@ -5,0 +5,0 @@ "modules" : {

@@ -8,5 +8,4 @@ var DNode = require('dnode');

var ev = new EventEmitter;
ev.emit = ev.emit.bind(ev);
DNode.expose(ev, 'emit');
ev.on('test1', function (a, b, c) {

@@ -23,5 +22,5 @@ assert.equal(a, 1);

var self = this;
DNode.expose(self, 'on');
DNode.expose(self, 'removeListener');
DNode.expose(self, 'emit');
self.on = self.on.bind(self);
self.removeListener = self.removeListener.bind(self);
self.emit = self.emit.bind(self);

@@ -28,0 +27,0 @@ self.pass = function (name, em) {

@@ -13,6 +13,6 @@ var DNode = require('dnode');

moo : function (reply) { reply(100) },
sTimesTen : DNode.sync(function (n) {
sTimesTen : function (n, cb) {
assert.equal(n, 5);
return n * 10;
}),
cb(n * 10);
},
}).listen(port.toString()); // test for stringified ports too why not

@@ -19,0 +19,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc