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

@hazeljs/flow-runtime

v1.0.3

Published

Standalone deployable flow runtime service (HazelJS)

Readme

@hazeljs/flow-runtime

npm version npm downloads License: Apache-2.0

Standalone HTTP service for @hazeljs/flow workflows. Expose flows via REST so other systems can start runs, tick, resume waiting runs, and read status and timeline—or invoke the runtime from your app with runFlowRuntime({ flows, port, databaseUrl?, services }) so you don't reimplement the server.

Features

  • REST API — Start runs, tick, resume, get run status and timeline, list flows, health check
  • In-memory by default — No database required; set DATABASE_URL (or pass databaseUrl) only when you want durable persistence
  • Fallback to in-memory — If DATABASE_URL is missing or the connection fails, the runtime uses in-memory storage and logs a message
  • Recovery — On startup, picks up any RUNNING runs (when using Prisma storage) and ticks them so they continue after a restart
  • Programmatic API — Call runFlowRuntime({ port, databaseUrl?, flows, services? }) from your app to register your own flows and optional services (logger, slack, etc.) while the package owns the HTTP server

Requirements

  • Node.js — 20+
  • @hazeljs/flow — Required peer; install with pnpm add @hazeljs/flow
  • PORT — Optional; default 3000
  • DATABASE_URL — Optional; if set and connection succeeds, uses Prisma storage for durability and recovery. If unset or connection fails, uses in-memory storage.

Installation

pnpm add @hazeljs/flow-runtime @hazeljs/flow

Run as a standalone process

# From monorepo root
pnpm flow:runtime

# Or from this package
pnpm dev    # watch mode
pnpm start  # after build: node dist/main.js

Uses default demo flows. With no DATABASE_URL, runs in-memory. Set DATABASE_URL for Postgres persistence and recovery.

Run from your app (programmatic)

Register your own flows and optional services; the package runs the HTTP server and recovery:

import { runFlowRuntime } from '@hazeljs/flow-runtime';
import { buildFlowDefinition } from '@hazeljs/flow';
import { OrderFlow } from './flows/OrderFlow';

await runFlowRuntime({
  port: 3000,
  databaseUrl: process.env.DATABASE_URL, // optional; in-memory if omitted or connection fails
  flows: [buildFlowDefinition(OrderFlow)],
  services: { logger: myLogger, slack: slackClient }, // optional; injected into flow context
});

API

| Method | Path | Description | | ------ | -------------------------- | ----------------------------------------------------- | | POST | /v1/runs/start | Start a flow run (body: flowId, version, input) | | POST | /v1/runs/:runId/tick | Advance a running run one step | | POST | /v1/runs/:runId/resume | Resume a waiting run (body: payload for the wait) | | GET | /v1/runs/:runId | Get run status | | GET | /v1/runs/:runId/timeline | Get run event timeline | | GET | /v1/flows | List registered flows | | GET | /health | Health check |

Example

See hazeljs-flow-example for a full app that registers order, approval, and fraud-detection flows and starts the runtime with runFlowRuntime(...).

License

Apache 2.0 © HazelJS