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

@zuzjs/pm

v0.0.22

Published

Production grade process manager for the @zuzjs ecosystem

Readme

@zuzjs/pm

A modular process manager built for the @zuzjs ecosystem.


Architecture

src/
├── types.ts          – All shared types, enums, and interfaces
├── logger.ts         – Thin, colorized logger (swap for @zuzjs/core)
├── store.ts          – Reactive in-process state store (swap for @zuzjs/store)
├── probe.ts          – Liveness probes: http | tcp | exec
├── worker.ts         – Single-app lifecycle (Fork + Cluster modes)
├── process-manager.ts– Controller that owns all Worker instances
├── ipc-server.ts     – Unix socket / Named Pipe IPC server
├── daemon.ts         – Long-running background daemon entry point
├── client.ts         – Programmatic API + daemon spawner
├── cli.ts            – `zpm` CLI
└── index.ts          – Public barrel export

Install

npm install @zuzjs/pm

CLI Usage

# Start the daemon implicitly (auto-spawned on first command)
zpm start ./dist/server.js --name api --port 3000

# Cluster mode – one worker per CPU core
zpm start ./dist/server.js --name api --cluster --port 3000

# Dev mode – restart on file change
zpm start ./dist/server.js --name api --dev

# Inspect
zpm list
zpm stats
zpm stats api

# Control
zpm restart api
zpm stop    api
zpm delete  api

# Daemon
zpm kill-daemon

Programmatic API

import { ZPMClient, WorkerMode } from "@zuzjs/pm";

const pm = new ZPMClient();

// Spawn daemon if not already running
await pm.ensureDaemon();

// Start a worker
await pm.start({
  name:       "api",
  scriptPath: "/abs/path/to/dist/server.js",
  port:       3000,
  mode:       WorkerMode.Fork,       // or WorkerMode.Cluster
  instances:  1,                     // ignored in Fork mode
  devMode:    false,
  env:        { LOG_LEVEL: "debug" },
  killTimeout: 5000,                 // ms before SIGKILL
  maxBackoff:  16000,                // ms backoff ceiling

  // Optional liveness probe
  probe: {
    type:             "http",
    target:           "http://localhost:3000/health",
    intervalSeconds:  10,
    timeoutSeconds:   5,
    failureThreshold: 3,
  },
});

// Telemetry
const stats = await pm.stats("api");
console.log(stats);
// [{ name, status, pid, uptime, restartCount, cpu, memoryRss, memoryHeap, mode, instances }]

// Control
await pm.restart("api");
await pm.stop("api");
await pm.delete("api");

// Kill the daemon itself
await pm.killDaemon();

Embedding Without the Daemon

For tight integration (e.g., inside an existing long-running process):

import { ProcessManager, WorkerMode } from "@zuzjs/pm";

const manager = new ProcessManager();

await manager.start({
  name:       "worker",
  scriptPath: "./dist/worker.js",
  mode:       WorkerMode.Fork,
});

// Graceful shutdown on SIGTERM
process.on("SIGTERM", async () => {
  await manager.stopAll();
  process.exit(0);
});

Resiliency Features

| Feature | Details | |---|---| | Exponential Backoff | Starts at 1s, doubles on each crash, caps at 16s (configurable) | | Stability Reset | After 5s of uptime, restart counter and backoff reset | | Immediate Crash Detection | Crashes within 1.5s are treated as build errors – no retry until next file change | | Liveness Probes | http, tcp, or exec – configurable interval, timeout, and failure threshold | | Graceful Shutdown | SIGTERM → wait killTimeout ms → SIGKILL | | Dev Mode | Chokidar watches the script's directory; restarts on change/add events | | Port Clearing | Calls fuser -k to free a busy port before spawning |


Build

npm install
npm run build      # tsc → dist/
npm run dev        # tsc --watch