Socket
Socket
Sign inDemoInstall

socket.io-emitter

Package Overview
Dependencies
Maintainers
2
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 1.0.0 to 1.1.0

6

History.md
1.1.0 / 2017-01-12
==================
* [docs] Updated README with more usage examples. (#33)
* [feature] Removed clientUri() (#41)
1.0.0 / 2015-12-10

@@ -3,0 +9,0 @@ ==================

16

index.js

@@ -51,3 +51,3 @@

if ('string' == typeof redis) {
redis = clientUri(redis);
redis = client(redis);
}

@@ -159,15 +159,1 @@

};
/**
* Create a redis client from a
* `host:port` uri string.
*
* @param {String} uri
* @return {Client} node client
* @api private
*/
function clientUri(uri){
uri = uri.split(':');
return client(uri[1], uri[0]);
}
{
"name": "socket.io-emitter",
"version": "1.0.0",
"version": "1.1.0",
"description": "",

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

@@ -18,3 +18,30 @@

```
```js
// Different constructor options.
//1. Initialize with host:port string
var io = require('socket.io-emitter')("loaclhost:6379")
// 2. Initlize with host, port object.
var io = require('socket.io-emitter')({ host: '127.0.0.1', port: 6379 });
// 3. Can use other node_redis compatible client eg; ioredis.
var Redis = require("ioredis");
var redis = new Redis();
var io = require('socket.io-emitter')(redis);
// Make the emitter works with redis clustered environment.
var Cluster = new Redis.Cluster([
{
host: "localhost",
port: 6379
},
{
host: "localhost",
port: 6378
},
]);
var io = require('socket.io-emitter')(Cluster);
```
## API

@@ -21,0 +48,0 @@

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