Skip to content

Commit

Permalink
[chore] Release 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed May 13, 2017
1 parent a3cbc84 commit 2adcdb2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

3.0.0 / 2017-05-13
==================

* [feat] Make `of` return a new Emitter instance (#56)
* [feat] Make the module compatible with socket.io-redis 5.x (#55)

2.0.0 / 2017-01-12
==================

Expand Down
25 changes: 25 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@ var io = require('socket.io-emitter')(Cluster);

```

## Examples

```js
var io = require('socket.io-emitter')({ host: '127.0.0.1', port: 6379 });

// sending to all clients
io.emit('broadcast', /* ... */);

// sending to all clients in 'game' room
io.to('game').emit('new-game', /* ... */);

// sending to individual socketid (private message)
io.to(<socketid>).emit('private', /* ... */);

var nsp = io.of('/admin');

// sending to all clients in 'admin' namespace
nsp.emit('namespace', /* ... */);

// sending to all clients in 'admin' namespace and in 'notifications' room
nsp.to('notifications').emit('namespace', /* ... */);
```

**Note:** acknowledgements are not supported

## Error handling

Access the `redis` to subscribe to its `error` event:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket.io-emitter",
"version": "2.0.0",
"version": "3.0.0",
"description": "",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit 2adcdb2

Please sign in to comment.