sin

socket.io-nats-emitter

Allows you to communicate with socket.io servers easily from non-socket.io processes through NATS.

Showing:

Popularity

Downloads/wk

3

GitHub Stars

2

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

4

Size (min+gzip)

11.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

socket.io-nats-emitter

socket.io-nats-emitter allows you to communicate with socket.io servers through NATS easily from non-socket.io processes, based on the socket.io-emitter.

The socket.io servers instances should use this adapter socket.io-nats or one that implements the protocol.

Install

npm install socket.io-nats-emitter

How to use

var io = require('socket.io-nats-emitter')();
setInterval(function(){
  io.emit('time', new Date);
}, 5000);

API

Emitter(opts)

The following options are allowed:

  • key: the name of the key to pub/sub events on as prefix (socket.io)
  • delimiter: optional, channels delimiter
  • uid: optional, emitter identifier (emitter)
  • nc: optional, the nats client
  • ...: nats client options (ignored if nats client is supplied)

Emitter#to(room:String):Emitter

Emitter#in(room:String):Emitter

Specifies a specific room that you want to emit to.

Emitter#of(namespace:String):Emitter

Specifies a specific namespace that you want to emit to.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100