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

@pattern-js/runtime-node

v0.2.2

Published

Pattern runtime adapter for Node — HTTP/WS host, worker-thread pool, connection registry, sqlite trace sink.

Readme

@pattern-js/runtime-node

The Node runtime adapter for Pattern. Thin by design — it binds external sources to boundary triggers and provides isolation. All platform code lives here so @pattern-js/core stays runtime-neutral.

npm install @pattern-js/core @pattern-js/runtime-node

Project loader (recommended)

import { loadProject } from "@pattern-js/runtime-node";

const { engine, start } = await loadProject();  // reads pattern.config.json
const { ports } = await start();                // derives routes from workflows

loadProject installs mods, loads workflow .json files, and returns a ready HTTP host. See projects & mods.

Hosts

Routing is declarative: the HTTP host derives routes from the boundary.http.request nodes of registered workflows (method/path/port/cors/ body+query JSON-Schema all in config). No programmatic route table.

import { Engine } from "@pattern-js/core";
import { createHttpHost } from "@pattern-js/runtime-node";

const engine = new Engine();
engine.registerWorkflow(api);                 // route declared inside the workflow
const host = createHttpHost(engine, { defaultPort: 3000 });
const { ports } = await host.start();         // re-derives live as workflows change

| Host | Binds | Out-gate | |------|-------|----------| | createHttpHost | boundary.http.request (declarative routes) | boundary.http.response (buffered/sse/chunked) | | createWsHost | boundary.ws.message / open / close | boundary.ws.send | | runCli | boundary.cli | boundary.cli.exit | | createScheduleHost | boundary.schedule (interval or 5-field cron) | result discarded/traced |

Isolation: worker-thread pool

A RunTransport that runs each workflow on a node:worker_threads worker — a drop-in for the in-process transport. Streamed out-gate results are reconstructed on the host; cancellation crosses the seam.

import { WorkerPoolTransport } from "@pattern-js/runtime-node";
const engine = new Engine({ transport: new WorkerPoolTransport({ size: 4 }) });

Also here

  • NodeConnectionRegistryConnectionRegistry bound to live WebSocket sockets (rooms, broadcast, streamed sends).
  • Trace sinksjsonlTraceSink(path) and sqliteTraceSink(path) for persistence (core only emits).
  • loadMods(engine, specifiers) — load external plugin mods by module specifier.
  • pattern CLIpattern graph|validate|dev.

CLI

pattern graph workflow.json      # render the graph in the terminal
pattern validate workflow.json   # located, human-readable validation errors
pattern dev [entry]              # run an entry with file-watch hot-reload