Socket
Socket
Sign inDemoInstall

socket.io-emitter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socket.io-emitter - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.travis.yml

7

History.md
0.2.0 / 2014-06-07
==================
* package: bump dependencies
* added possibility to connect with unix domain socket
* added support for emitting to namespace. [Rase-]
0.1.0 / 2014-03-12

@@ -3,0 +10,0 @@ ==================

27

index.js

@@ -52,5 +52,7 @@

if (!redis) {
if (!opts.host) throw new Error('Missing redis `host`');
if (!opts.port) throw new Error('Missing redis `port`');
redis = client(opts.port, opts.host);
if (!opts.socket && !opts.host) throw new Error('Missing redis `host`');
if (!opts.socket && !opts.port) throw new Error('Missing redis `port`');
redis = opts.socket
? client(opts.socket)
: client(opts.port, opts.host);
}

@@ -93,2 +95,14 @@

/**
* Limit emission to certain `namespace`.
*
* @param {String} namespace
*/
Emitter.prototype.of = function(nsp) {
debug('nsp set to %s', nsp);
this._flags.nsp = nsp;
return this;
};
/**
* Send the packet.

@@ -105,2 +119,9 @@ *

packet.data = args;
// set namespace to packet
if (this._flags.nsp) {
packet.nsp = this._flags.nsp;
delete this._flags.nsp;
} else {
packet.nsp = '/';
}

@@ -107,0 +128,0 @@ // publish

14

package.json
{
"name": "socket.io-emitter",
"version": "0.1.0",
"version": "0.2.0",
"description": "",

@@ -9,5 +9,13 @@ "dependencies": {

"msgpack-js": "0.3.0",
"has-binary-data": "0.1.0",
"socket.io-parser": "2.1.1"
"has-binary-data": "0.1.1",
"socket.io-parser": "2.2.0"
},
"devDependencies": {
"mocha": "1.18.1",
"expect.js": "0.3.1",
"socket.io": "1.0.4",
"socket.io-client": "1.0.4",
"socket.io-redis": "0.1.3",
"redis": "0.10.1"
}
}

@@ -29,2 +29,3 @@

- `port`: port to connect to redis on (`6379`)
- `socket`: unix domain socket to connect to redis on (`"/tmp/redis.sock"`)

@@ -47,4 +48,9 @@ ### Emitter(clientUri[, opts]

### Emitter#of(namespace:String):Emitter
Specifies a specific namespace that you want to emit to.
## License
MIT
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