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

@the-real-insight/tri-bpmn-engine

v0.1.13

Published

BPMN 2.0 subset execution engine with event sourcing

Readme

tri-bpmn-engine

BPMN 2.0 subset execution engine with event sourcing, optimistic concurrency, and external decision evaluation.

Stack

  • TypeScript on Node.js
  • Express
  • MongoDB

Setup

npm install
cp .env.example .env
# Edit .env and set MONGO_URL (default: mongodb://localhost:27017/tri-bpmn-engine)

Run

Requires MongoDB. Then:

npm run dev

Implemented

  • Model Service: BPMN XML parsing, graph normalization
  • Runtime API: Deploy, start instance, complete work, submit decision, query state
  • Core flow: Start event, end event, sequence flow
  • Tasks: Service task, user task (external callback via outbox)
  • Gateways: XOR (split + join), AND (split + join)
  • Workers: Claims and processes continuations; in-process polling
  • Outbox: CALLBACK_WORK, CALLBACK_DECISION enqueued for delivery
  • WebSocket: Push callbacks to clients at /ws (REST mode)
  • Event sourcing: Append-only events per instance
  • Optimistic concurrency: Versioned state updates

Not yet implemented

  • OR gateway (inclusive, conservative join)
  • Timers (intermediate catch, boundary)
  • Message events (catch, throw)
  • Boundary error events
  • Embedded subprocess, Call activity
  • Outbox dispatcher (delivery loop)
  • OR-join upstream metadata
  • Full idempotency (commandId) for all mutating APIs

API

Deploy definition

curl -X POST http://localhost:3000/v1/definitions \
  -H "Content-Type: application/json" \
  -d '{"name":"Test","version":1,"bpmnXml":"<bpmn:definitions>...</bpmn:definitions>"}'

Start instance

curl -X POST http://localhost:3000/v1/instances \
  -H "Content-Type: application/json" \
  -d '{"commandId":"cmd-1","definitionId":"<definitionId>"}'

Submit decision (XOR gateway)

curl -X POST http://localhost:3000/v1/instances/<instanceId>/decisions/<decisionId> \
  -H "Content-Type: application/json" \
  -d '{"commandId":"cmd-2","outcome":{"selectedFlowIds":["<flowId>"]}}'

Complete work item

curl -X POST http://localhost:3000/v1/instances/<instanceId>/work-items/<workItemId>/complete \
  -H "Content-Type: application/json" \
  -d '{"commandId":"cmd-2"}'

Query instance

curl http://localhost:3000/v1/instances/<instanceId>
curl http://localhost:3000/v1/instances/<instanceId>/state

Publishing

On every push to main, a GitHub Action:

  1. Runs tests (npm run test:sdk)
  2. Bumps the patch version (0.1.00.1.1)
  3. Publishes to npm
  4. Commits the version bump back to the repo (with [skip ci] to avoid loops)

Setup: Add NPM_TOKEN as a repository secret in GitHub. Create a token at npmjs.com/access-tokens with "Automation" type (or "Publish" for granular access).


Test

npm test              # all tests (unit + conformance)
npm run test:unit      # unit tests only (no MongoDB)
npm run test:conformance   # conformance tests (requires MongoDB, see readme/TEST.md)
npm run test:sdk       # SDK tests (requires MongoDB)
npm run test:worklist  # worklist role-filter tests (requires MongoDB)
npm run test:integration   # integration script (requires MongoDB)