New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@socket.io/redis-emitter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socket.io/redis-emitter - npm Package Versions

5.1.0

Diff

Changelog

Source

5.1.0 (2023-01-12)

Features

  • add option to allow usage of custom parser (#121) (48bdd87)
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);
    }
  }
});
darrachequesne
published 5.0.0 •

Changelog

Source

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

Features

  • add support for the toJSON() method when encoding (#113) (3a6d94d)
darrachequesne
published 4.1.1 •

Changelog

Source

4.1.1 (2022-01-04)

Bug Fixes

  • typings: fix namespace typed-events inheritance (#108) (53c73e1)
darrachequesne
published 4.1.0 •

Changelog

Source

4.1.0 (2021-05-11)

Features

  • implement the serverSideEmit functionality (5feabda)
darrachequesne
published 4.0.0 •

Changelog

Source

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.

Features

  • allow excluding all sockets in a room (#92) (ad920e4)
  • include features from Socket.IO v4 (a70db12)
  • rename the package to @socket/redis-emitter (592883e)

BREAKING CHANGES

  • 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.

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