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

@novahelm/realtime

v2026.6.1

Published

NovaHelm realtime — WebSocket + Redis pub/sub channels.

Readme

@novahelm/realtime

Typed realtime layer for NovaHelm — Socket.io server and client with Redis adapter, presence tracking, room management, message ordering, and reconnection backoff.


Quick Start

pnpm add @novahelm/realtime

Server

import { createRealtimeServer } from "@novahelm/realtime";
import { createServer } from "http";

const httpServer = createServer();

const io = createRealtimeServer({
  httpServer,
  redisUrl: "redis://localhost:6379",
  cors: { origin: "http://localhost:3000" },
});

io.on("connection", (socket) => {
  console.log("connected:", socket.id);
});

httpServer.listen(3001);

Client

import { createRealtimeClient } from "@novahelm/realtime/client";

const socket = createRealtimeClient({
  url: "http://localhost:3001",
});

socket.on("entity:updated", (data) => {
  console.log("Entity updated:", data);
});

Presence Tracking

Track online users per project with Redis-backed presence:

import { createPresenceTracker } from "@novahelm/realtime";

const presence = createPresenceTracker(redis, io);

// In socket handler
presence.join(socket, { userId: "u_123", projectSlug: "my-app" });

// Query who's online
const online = await presence.getOnline("my-app");

Room Management

Manage named rooms with metadata and member counts:

import { createRoomManager } from "@novahelm/realtime";

const rooms = createRoomManager(redis, io);

await rooms.join(socket, "project:my-app:chat");
const info = await rooms.getRoom("project:my-app:chat");
const summary = await rooms.listRooms("project:my-app:*");

Message Ordering

Guarantee in-order delivery with sequence numbers and gap detection:

import { createMessageSequencer } from "@novahelm/realtime";

const sequencer = createMessageSequencer({
  onMessage: (msg) => applyUpdate(msg),
  onGap: (expected, received) => requestMissing(expected, received),
});

socket.on("entity:updated", (data) => {
  sequencer.receive(data);
});

Platform Event Bridge

Bridge platform events from Redis pub/sub into Socket.io rooms:

import { bridgePlatformEvents } from "@novahelm/realtime";

bridgePlatformEvents({
  io,
  redis: subscriberRedis,
  channelPrefix: "nova:",
});

API Reference

| Export | Description | |--------|-------------| | createRealtimeServer(config) | Create Socket.io server with Redis adapter | | createRealtimeClient(config) | Create typed Socket.io client (from /client) | | registerProjectNamespace(io, slug) | Register a /project:{slug} namespace | | bridgePlatformEvents(config) | Bridge Redis pub/sub to Socket.io | | createPresenceTracker(redis, io) | Redis-backed presence tracking | | createRoomManager(redis, io) | Named room management | | createMessageSequencer(opts) | In-order message delivery | | createBackoffStrategy(opts) | Exponential backoff for reconnection | | applyBackoff(socket) | Apply backoff strategy to a socket | | recordRealtimeEvent(redis, event) | Record event throughput metrics | | readRealtimeEventStats(redis) | Read rolling-window event stats |