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

@absolutejs/sync-bus-redis

v0.1.0

Published

Redis pub/sub ClusterBus for @absolutejs/sync — cross-instance fan-out via PUBLISH/SUBSCRIBE. Sibling to @absolutejs/sync-bus-pg; faster fanout, better geo-replication story. Works with any Redis client (ioredis, node-redis, etc.) via a narrow tag-templat

Readme

@absolutejs/sync-bus-redis

Redis pub/sub ClusterBus for @absolutejs/sync. Sibling to @absolutejs/sync-bus-pg — same ClusterBus contract, different transport.

Docs: absolutejs.com/documentation/cluster-bus-overview#redis-adapter

When to use Redis vs Postgres

| Concern | sync-bus-redis | sync-bus-pg | |---|---|---| | Payload size | No cap — JSON through | 8KB NOTIFY cap (spill-table fallback) | | Fan-out latency at 10+ subscribers | In-memory, low | WAL-replicated, higher | | Geo-replication | Native (Redis Cluster, ElastiCache, Memorystore, Upstash) | Heavy ops (PG logical replication) | | Delivery semantics | At-most-once (no message retention) | At-most-once (NOTIFY) + spill rows for oversized | | Already in your stack? | If yes → win-win | If yes → win-win |

The headline tradeoff. Redis is in-memory pub/sub — a subscriber that's disconnected when a message fires misses it. For cross-instance resume past shard reboot, pair with engine.exportChangeLog() / importChangeLog() (sync 1.19.0+) regardless of which bus you use.

Install

bun add @absolutejs/sync @absolutejs/sync-bus-redis
# Plus a Redis client — bring your own:
bun add ioredis            # OR
bun add redis              # node-redis v4+

The adapter has no hard runtime dep on a specific Redis client.

Usage with ioredis

import { Redis } from 'ioredis';
import { createSyncEngine } from '@absolutejs/sync/engine';
import { createRedisClusterBus } from '@absolutejs/sync-bus-redis';

const publisher = new Redis(process.env.REDIS_URL!);
const subscriberClient = new Redis(process.env.REDIS_URL!);

// ioredis: a subscribed connection can't issue other commands.
// Bridge its EventEmitter API into our (channel, listener) shape:
const subscriber = {
  subscribe: async (channel: string, listener: (msg: string) => void) => {
    await subscriberClient.subscribe(channel);
    const handler = (chan: string, msg: string) => {
      if (chan === channel) listener(msg);
    };
    subscriberClient.on('message', handler);
    return async () => {
      subscriberClient.off('message', handler);
      await subscriberClient.unsubscribe(channel);
    };
  },
};

const bus = createRedisClusterBus({ publisher, subscriber });
const engine = createSyncEngine({ instanceId: 'shard-A' });
await engine.connectCluster(bus);

Usage with node-redis v4+

import { createClient } from 'redis';
import { createRedisClusterBus } from '@absolutejs/sync-bus-redis';

const publisher = createClient({ url: process.env.REDIS_URL });
const subscriberClient = publisher.duplicate();
await Promise.all([publisher.connect(), subscriberClient.connect()]);

// node-redis: subscribe takes a callback directly.
const subscriber = {
  subscribe: async (channel: string, listener: (msg: string) => void) => {
    await subscriberClient.subscribe(channel, listener);
    return async () => {
      await subscriberClient.unsubscribe(channel);
    };
  },
};

const bus = createRedisClusterBus({ publisher, subscriber });

API

createRedisClusterBus({
  publisher,         // RedisPublisher — publish(channel, message)
  subscriber,        // RedisSubscriber — subscribe(channel, listener) → unsubscribe fn
  channel?,          // default 'absolutejs_sync_cluster'
  onError?,          // logger for parse / delivery failures
});

Returns ClusterBus & { metrics() }. Pass to engine.connectCluster(bus).

bus.metrics()

{
  published: number;             // PUBLISH calls
  received: number;              // messages parsed + delivered to onMessage
  publishErrors: number;         // publisher.publish() rejections
  subscribeErrors: number;       // JSON.parse failures on incoming messages
  totalSubscribersReached: number; // sum of counts Redis returned from PUBLISH
                                 // — a drop to 0 when you expect peers signals
                                 // subscriber disconnects (partition, restart)
}

License

Apache 2.0. Tier B substrate-adjacent under the AbsoluteJS licensing policy — rides @absolutejs/sync (BSL Tier A).