- 5.1.0 (Jan 2023)
- 5.0.0 (Sep 2022)
- 4.1.1 (Jan 2022)
- 4.1.0 (May 2021)
- 4.0.0 (Mar 2021)
- 3.1.2 (Dec 2020)
- 3.2.0 (Dec 2020)
- 3.1.1 (Oct 2017)
- 3.1.0 (Aug 2017)
- 3.0.1 (May 2017)
- 3.0.0 (May 2017)
- 2.0.0 (Jan 2017)
- 1.1.0 (Jan 2017)
- 1.0.0 (Dec 2015)
- 0.3.0 (Dec 2015)
- 0.2.0 (Jun 2014)
5.1.0 (2023-01-12)
import { Emitter } from "@socket.io/redis-emitter";
import { createClient } from "redis";
const redisClient = createClient();
await redisClient.connect();
const io = new Emitter(redisClient, {
parser: {
encode(msg) {
return JSON.stringify(msg);
}
}
});
5.0.0 (2022-09-07)
Important note! There is a non backward-compatible change regarding Date objects, which means that the adapter may not be able to properly decode them.
- Reference: https://github.com/darrachequesne/notepack/releases/tag/3.0.0
- Diff: https://github.com/darrachequesne/notepack/compare/2.3.0...3.0.1
4.1.1 (2022-01-04)
4.1.0 (2021-05-11)
- implement the serverSideEmit functionality (5feabda)
4.0.0 (2021-03-17)
Important note: the name of the package was updated from socket.io-emitter
to @socket.io/redis-emitter
in order to better reflect the relationship with Redis.
- allow excluding all sockets in a room (#92) (ad920e4)
- include features from Socket.IO v4 (a70db12)
- rename the package to @socket/redis-emitter (592883e)
- the "redis" package is not installed by default anymore, you'll now need to create your own redis client and pass it to the Emitter constructor
Before:
const io = require("socket.io-emitter")({ host: "127.0.0.1", port: 6379 });
After:
const { Emitter } = require("@socket.io/redis-emitter");
const { createClient } = require("redis");
const redisClient = createClient();
const io = new Emitter(redisClient);
io.to()
is now immutable
Previously, broadcasting to a given room (by calling io.to()) would mutate the io instance, which could lead to surprising behaviors, like:
io.to("room1");
io.to("room2").emit(/* ... */); // also sent to room1
// or with async/await
io.to("room3").emit("details", await fetchDetails()); // random behavior: maybe in room3, maybe to all clients
Calling io.to()
(or any other broadcast modifier) will now return an immutable instance.
3.1.2 (2020-12-29)
- binary: fix binary events being marked as regular events (#76) (52483f9)
- handle missing namespace prefix (03efd37)
3.2.0 (2020-12-29)
- handle missing namespace prefix (03efd37)
3.1.1 (2017-10-12)
3.1.0 (2017-08-03)
- add support for arraybuffer (2672758)
3.0.1 (2017-05-13)
3.0.0 (2017-05-13)
- make
of
return a new Emitter instance (a3cbc84) - make the module compatible with socket.io-redis 5.x (119b3e6) (by @v4l3r10)