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

redis-process-worker

v0.0.3001-beta

Published

A worker process helper for using redis cache and streams.

Readme

redis-process-worker

Disclaimer: This package is in developer beta and its API or features may change at any time.

A worker process helper for using Redis cache and streams. Provides a simple interface for background workers, stream communication, and a global cache.

Features

  • Listen to and post messages on Redis streams
  • Log messages to a global logging stream
  • Use a global cache (Redis)
  • Modular connectors for server and client (WebSocket)
  • TypeScript support

Installation

npm install redis-process-worker

or

bun add redis-process-worker

Usage

This package provides several utilities for working with Redis streams, cache, logging, and background workers. See the examples directory for more advanced usage and worker implementations.

Components

| File | Purpose | | ---------------------- | ----------------------------------------------------------------------- | | ActionRepo | Utilities for managing and storing actions in Redis. | | LogRepo | Utilities for logging and retrieving logs from Redis. | | RedisHub | Redis stream and cache abstraction, core Redis logic. | | RedisHubSocket | WebSocket server for stream and cache communication. | | RedisHubSocketClient | WebSocket client for connecting to the RedisHubSocket server. | | RedisRepo | Low-level Redis repository utilities. | | WorkerRepo | Background worker logic using ProcessWorker for stream and cache tasks. |

Action

The Action system provides utilities for managing and storing actions in Redis. It enables workers to dispatch, track, and process actions across distributed systems, ensuring reliable and decoupled task execution.

Log

The Log system provides utilities for logging and retrieving logs from Redis. It allows workers and other components to write log messages to a global logging stream, which can be monitored or queried for debugging and auditing purposes.

RedisHub

RedisHub is the core abstraction for Redis streams and cache. It manages the low-level communication with Redis, handling stream subscriptions, message delivery, and cache operations. It serves as the backbone for all stream and cache interactions in the system.

RedisRepo

RedisRepo contains low-level repository utilities for interacting directly with Redis. It provides foundational methods for connecting, reading, writing, and managing data in Redis, supporting higher-level abstractions like RedisHub and ActionRepo.

Worker

A Worker is a background process that uses the ProcessWorker class to listen to streams, post messages, and interact with the global cache. Workers can be used for various tasks such as running servers, file watchers, or any background job that requires inter-process communication.

Examples by Component

ActionRepo Example

const repo = await ActionRepo.createRepo()
const action = repo.create({
  name: "test-action",
  arg: { foo: "bar" },
})
console.log(action)

LogRepo Example

const repo = await LogRepo.createRepo()
// add log
await repo.log("This is a log message")
await repo.log("This is a log message", "debug")
// or
await repo.saveLog({
  id: "log-1",
  type: "log",
  level: "info",
  message: "This is a log message",
  timestamp: Date.now(),
})

RedisHub Example

const hub = await RedisHub.createHub()
console.log(hub)

RedisHubSocket Example

const socketServer = await RedisHubSocket.createHub()
console.log(socketServer)

RedisHubSocketClient Example

const url = "ws://localhost:6379"
const client = await RedisHubSocketClient.connect(url)
console.log(client)

RedisRepo Example

const repo = await RedisRepo.createRepo()
console.log(repo)

WorkerRepo Example

const repo = await WorkerRepo.createRepo()
console.log(repo)