npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pubber-subber/redis

v0.0.1

Published

Redis (and Redis-compatible: Valkey, KeyDB, Dragonfly) pub/sub adapter for @pubber-subber.

Readme

@pubber-subber/redis

Redis pub/sub adapter for @pubber-subber/core — built on ioredis. Works with Redis, Valkey, KeyDB, Dragonfly, or any Redis-protocol-compatible server.

Install

pnpm add @pubber-subber/core @pubber-subber/redis ioredis

ioredis is a peer dependency — install it alongside.

Quick start

import { PubSub } from '@pubber-subber/core';
import { redis } from '@pubber-subber/redis';

const pubsub = new PubSub({
  adapter: redis({ url: 'redis://localhost:6379' }),
});

await pubsub.subscribe('users.*', (msg) => {
  console.log(msg.topic, msg.payload);
});

await pubsub.publish('users.created', { id: 1, name: 'Alice' });

Options

redis({
  url?: string;
  options?: RedisOptions;                            // ioredis-compatible
  clients?: { publisher: Redis; subscriber: Redis };
  codec?: Codec;
})

| Option | Notes | | --- | --- | | url | Standard Redis URL: redis://[:password@]host:port[/db], rediss://... for TLS. | | options | Full ioredis RedisOptions. Merged with url. | | clients | Bring your own { publisher, subscriber } pair. The adapter will not call quit() on them. publisher and subscriber must be distinct clients — Redis rejects non-pub/sub commands on a SUBSCRIBE-d connection. | | codec | Payload encoder/decoder. Default jsonCodec(). |

Publish meta

await pubsub.publish('orders.created', payload, { channel: 'orders' });

| Field | Notes | | --- | --- | | channel | Override the on-wire Redis channel without changing the logical AdapterMessage.topic. |

Subscribe meta

await pubsub.subscribe('orders', handler, { pattern: true });

| Field | Default | Notes | | --- | --- | --- | | pattern | auto-detected | Force PSUBSCRIBE even if the topic has no * or ?. Auto-detected from wildcards otherwise. |

Capabilities

{ publish: true, subscribe: true, patternSubscribe: true, ack: false }

How it works

  • Two internal connections: one publisher, one subscriber. Required by Redis (a SUBSCRIBE-d connection cannot issue other commands).
  • subscribe(topic, handler) issues SUBSCRIBE for exact channels and PSUBSCRIBE for patterns containing * or ? (override via meta.pattern: true).
  • Reference-counted: multiple subscribe() calls for the same channel only SUBSCRIBE once on the wire. UNSUBSCRIBE fires when the last handler goes away.
  • Reconnect: ioredis handles socket-level reconnects automatically. On the ready event, the adapter re-subscribes every live channel and pattern — no user-visible message loss for events published after the reconnect completes.

Caveats

  • Redis pub/sub is fire-and-forget. Subscribers that fall behind have their messages dropped server-side. Events published while the subscriber is disconnected are not buffered. If you need delivery guarantees, use Redis Streams (different adapter — not in this package) or a different transport.
  • capabilities.ack = false: there is no ack/nack to call on AdapterMessage.
  • For high message-frequency scenarios, watch ioredis's lazyConnect and connection pool tuning.

License

MIT