Comparing version 0.0.1 to 0.1.0
30
index.js
@@ -1,1 +0,29 @@ | ||
module.exports = require('./lib/socketmq'); | ||
var Url = require('url'); | ||
var net = require('./net') | ||
var Socket = require('./socket') | ||
exports.bind = function(url, options) { | ||
return createSocketMQ('bind', url, options) | ||
} | ||
exports.connect = function(url, options) { | ||
return createSocketMQ('connect', url, options) | ||
} | ||
function isProtocolSupported(protocol) { | ||
if (!net[protocol]) { | ||
var err = 'Transport "' + protocol + '" is not supported. SocketMQ supports: ' + Object.keys(net).join(', ') | ||
throw new Error(err) | ||
} | ||
return protocol | ||
} | ||
function createSocketMQ(type, url, options) { | ||
var target = Url.parse(url) | ||
var protocol = isProtocolSupported(target.protocol.slice(0, -1)) | ||
var socket = new Socket() | ||
net[protocol][type](target, socket, options) | ||
return socket | ||
} |
{ | ||
"name": "socketmq", | ||
"version": "0.0.1", | ||
"description": "Library for building application in ZeroMQ-like messaging semantics end to end. Build upon node.js and Engine.IO", | ||
"keywords": ["zeromq", "zmq", "message", "queue", "engine.io"], | ||
"author": "Senmiao Liu <zir.echo@gmail.com>", | ||
"version": "0.1.0", | ||
"description": "Lightweight stream-oriented messaging library for node.", | ||
"main": "index.js", | ||
"directories": { | ||
"example": "example" | ||
}, | ||
"dependencies": { | ||
"zmq": "2.2.0", | ||
"engine.io": "0.4.3", | ||
"engine.io-client": "0.4.3", | ||
"debug": "0.7.2" | ||
"amp": "0.3.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"chai": "*", | ||
"coffee-script": "1.4.x" | ||
"humanize-number": "0.0.2" | ||
}, | ||
"main": "index" | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "lsm", | ||
"license": "MIT" | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1
1
12510
17
357
3
2
0
+ Addedamp@0.3.1
+ Addedamp@0.3.1(transitive)
- Removeddebug@0.7.2
- Removedengine.io@0.4.3
- Removedengine.io-client@0.4.3
- Removedzmq@2.2.0
- Removedbase64id@0.1.0(transitive)
- Removedcommander@0.6.1(transitive)
- Removeddebug@0.6.00.7.2(transitive)
- Removedemitter-component@0.0.6(transitive)
- Removedengine.io@0.4.3(transitive)
- Removedengine.io-client@0.4.3(transitive)
- Removedengine.io-parser@0.1.1(transitive)
- Removedoptions@0.0.6(transitive)
- Removedtinycolor@0.0.1(transitive)
- Removedws@0.4.200.4.25(transitive)
- Removedxmlhttprequest@1.5.0(transitive)
- Removedzmq@2.2.0(transitive)