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

@capsium/reactor-node

v0.2.1

Published

Framework-agnostic Node.js Capsium reactor: serves .cap packages over node:http or as Connect/Express middleware, with layered storage, composite resolution and the §7 introspection API.

Readme

@capsium/reactor-node

Framework-agnostic Node.js reactor for Capsium packages: serves a .cap archive (or an unpacked package directory) over node:http or as Connect/Express middleware, per the canonical schemas in the Capsium org architecture decisions (../../../ARCHITECTURE.md):

  • static resource routes with manifest MIME types and a Cache-Control: public, max-age=31536000 default (route-level headers override it wholesale);
  • dataset routes under /api/v1/data/ served as JSON;
  • §5a layered storage (top-first overlay, .capsium-tombstones deletions resolve 404) and §4a composite packages (capsium://<guid>/<path> dependency resources resolved from a package store; only exported resources are visible; remap/responseRewrite/responseHeaders inheritance attributes honored);
  • the §7 introspection API under /api/v1/introspect/ (metadata, routes, content-hashes, content-validity);
  • handler routes answer 501 (not executed by this reactor);
  • GET/HEAD only — anything else is 405 with an Allow header;
  • unknown paths within the package get a JSON 404 ({"error": "..."}).

Init is fail-fast: the package is loaded and verified (§6 SHA-256 checksums, §6a digital signatures, §4a dependency resolution) before the handler is returned; problems throw typed errors (PackageConfigError, PackageIntegrityError, SignatureMismatchError, EncryptedPackageError, DependencyResolutionError, ...).

Install

npm install @capsium/reactor-node

Usage

Plain node:http:

import { createServer } from 'node:http';
import { createReactor } from '@capsium/reactor-node';

const handler = await createReactor({ package: './my-package.cap' });
createServer((req, res) => void handler(req, res)).listen(8864);

As Express/Connect middleware (the reactor owns its URL space — mount it at the path the package should be served from; next(err) is called only for unexpected internal errors):

import express from 'express';
import { createReactor } from '@capsium/reactor-node';

const app = express();
app.use('/my-package', await createReactor({ package: './my-package.cap' }));
app.listen(3000); // package served under /my-package

Options

await createReactor({
  // Package directory, .cap archive path, or an already-read
  // PackageReader result (CapsiumPackage model).
  package: './my-package.cap',
  // §4a store directory for composite packages (default: CAPSIUM_STORE env).
  store: './store',
  // Cache-Control default for static resources (route headers override).
  cacheControl: 'public, max-age=31536000',
  // RSA private key PEM for §6b encrypted packages.
  decryptionKeyPem: process.env.CAPSIUM_KEY,
});

CLI

Instant local serving over a plain node:http server (default port 8864, --port 0 picks an ephemeral port):

capsium-reactor-node ./my-package.cap --port 8080 --store ./store
# or from a checkout: node packages/reactor-node/dist/bin.js ./my-package.cap

Development

corepack yarn install
corepack yarn workspaces foreach -A --include @capsium/reactor-node run test

Tests drive the handler through real node:http servers bound to ephemeral ports (supertest-style); no Express dependency is used anywhere.