Socket.IO NATS adapter for:
@^1.0.0 of this packageFor just emitting there is also socket.io-nats-emitter
If you have any issues or feature requests please create a pull request.
This project has used socket.io-redis-adapter as a reference but
modernized most of the code (e.g. using async and promises and wrote test’s in TypeScript, too).
yarn add socket.io nats @mickl/socket.io-nats-adapter
import { Server } from 'socket.io';
import { connect } from 'nats';
import { createAdapter } from '@mickl/socket.io-nats-adapter';
const io = new Server(3000);
const connection = await connect();
io.adapter(createAdapter(connection));
MIT