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

@dudousxd/nestjs-diagnostics-redis

v0.2.2

Published

Cross-process transport for @dudousxd/nestjs-diagnostics — relay aviary:<lib>:<event> events over Redis pub/sub so @OnDiagnostic handlers fire across processes.

Readme

@dudousxd/nestjs-diagnostics-redis

Cross-process transport for @dudousxd/nestjs-diagnostics. A consumer-side relay forwards selected local aviary:<lib>:<event> channels onto Redis pub/sub and re-emits Redis-received events back onto the local diagnostics bus — so @OnDiagnostic handlers and getChannel(...).subscribe(...) reactions fire across processes/pods. The diagnostics core stays in-process and untouched; this is entirely opt-in.

Install

pnpm add @dudousxd/nestjs-diagnostics-redis @dudousxd/nestjs-diagnostics ioredis

Use (Nest)

Supply your own ioredis connections — a publisher and a separate subscriber (redis.duplicate(), since a subscribed connection can't publish). Use forRootAsync to pull your Redis client from DI:

import type Redis from 'ioredis';
import { Module } from '@nestjs/common';
import { DiagnosticsRedisModule } from '@dudousxd/nestjs-diagnostics-redis';
import { REDIS, RedisModule } from './redis.module'; // your app's Redis provider

@Module({
  imports: [
    DiagnosticsRedisModule.forRootAsync({
      imports: [RedisModule],
      inject: [REDIS],
      useFactory: (redis: Redis) => ({
        pub: redis,
        sub: redis.duplicate(),
        libs: ['durable', 'notifications'], // forward all events of these libs
      }),
    }),
  ],
})
export class AppModule {}

Now an @OnDiagnostic('durable', 'run.failed') handler in another process fires when a worker elsewhere emits it.

Already holding the connections? The static forRoot({ pub, sub, libs }) takes them directly — but prefer forRootAsync so the relay's clients come from the same DI container as the rest of your app.

Use (manual)

import { createDiagnosticsRedisRelay } from '@dudousxd/nestjs-diagnostics-redis';

const teardown = createDiagnosticsRedisRelay({
  pub: redis,
  sub: redis.duplicate(),
  channels: [{ lib: 'resilience', event: 'circuit-opened' }], // exact channels
  // or: libs: ['durable'] | all: true
});
// ... later
teardown();

How it works

  • Forwarder: subscribes to the selected local channels; each event is published to Redis as { node, env } (the diagnostics envelope).
  • Receiver: subscribes to the Redis channel; each message from a different node is re-emitted locally via the diagnostics bus, so all local subscribers fire.
  • Loop-safe: the receiver skips its own echoes (node === nodeId) and a re-emit guard stops a received event from being forwarded back — so two processes never ping-pong.

Notes

  • Payloads cross a process boundary as JSON — class instances arrive as plain objects (no methods/prototype), Date as an ISO string. Read fields, not behavior, in cross-process handlers.
  • Fire-and-forget, like the in-process bus: no guaranteed delivery, ordering, or replay.
  • The relay never opens or closes your Redis connections — you own their lifecycle. It never throws back into emit().