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

@nzelajs/core

v0.1.0

Published

Nzela workflow engine core: the transition loop with pluggable node handlers. Vendor-free.

Readme

@nzelajs/core

English below · Version francaise plus bas.

The Nzela engine core: the transition loop (guards, optimistic locking, event log, signed outbox, dependency joins) with node-entry behavior fully delegated to a NodeHandler registry. Vendor-free: its only dependencies are @nzelajs/blueprint and @nzelajs/ports.

English

Install

npm add @nzelajs/core @nzelajs/blueprint @nzelajs/ports

What it provides

  • NzelaEngine implements the WorkflowEngine port: dispatch (actor action, idempotent, optionally authorized deny-by-default), advanceCase (system clock tick over time-guarded auto transitions), resumeFromExternal / expireExternalWait (wait-node wake-up), and decideTask which delegates to the registered approval handler when it is an ApprovalCapableHandler.
  • No switch (node.type): on entering a node the core consults the NodeHandlerRegistry and delegates. A type with no registered handler is a resting node (safe default: nothing runs).
  • Transition sequence (ported from the source engine): assert guards, cancel source-node timers, cancel open source-node approval tasks, optimistic-locked status write, TRANSITION event, transition effects, signed case.transitioned outbox event, dependency joins (DAG wake-up of blocked instances), then enter the target node via its handler.
  • Helpers: InMemoryNodeHandlerRegistry, buildGuardContext / buildExpressionContext, parseIsoDuration, canonicalize / outboxEventMaterial (pure canonical signing material), requiredPermissionFor.

Wiring example

import { NzelaEngine, InMemoryNodeHandlerRegistry } from "@nzelajs/core";
import { registerGenericHandlers } from "@nzelajs/node-auto";

const handlers = new InMemoryNodeHandlerRegistry();
registerGenericHandlers(handlers); // state + auto; approval/subprocess/wait are opt-in packages

const engine = new NzelaEngine({
  uow, // UnitOfWork adapter (tenant-scoped transactions)
  blueprints, // BlueprintProvider adapter
  guards, // GuardRunner adapter
  effects, // EffectRunner adapter
  clock, // systemClock or fixedClock(...)
  outboxSigner, // HMAC signer
  handlers,
  // authorizer, resolverFactory, tenantContext: optional
});

Security note: authorization is opt-in but deny-by-default once an Authorizer is wired; the engine asks for transition.permission when declared, else the conventional submit/withdraw/dispatch mapping. Guards fail closed. The outbox payload is signed with a canonical, tenant-bound material.

Francais

Installation

npm add @nzelajs/core @nzelajs/blueprint @nzelajs/ports

Ce que ca fournit

  • NzelaEngine implemente le port WorkflowEngine : dispatch (action d'un acteur, idempotente, autorisation deny-by-default optionnelle), advanceCase (tick d'horloge sur les transitions auto gardees par le temps), resumeFromExternal / expireExternalWait (reveil des noeuds d'attente), et decideTask qui delegue au handler approval enregistre quand il est un ApprovalCapableHandler.
  • Aucun switch (node.type) : a l'entree d'un noeud, le coeur consulte le NodeHandlerRegistry et delegue. Un type sans handler = noeud au repos (defaut sur : rien ne s'execute).
  • Sequence de transition (portee du moteur source) : gardes, annulation des timers du noeud source, annulation des taches ouvertes du noeud source, ecriture du statut sous verrou optimiste, evenement TRANSITION, effets de transition, evenement outbox signe case.transitioned, jointures de dependances (reveil DAG), puis entree dans le noeud cible via son handler.
  • Helpers : InMemoryNodeHandlerRegistry, buildGuardContext / buildExpressionContext, parseIsoDuration, canonicalize / outboxEventMaterial, requiredPermissionFor.

Note de securite : l'autorisation est opt-in mais deny-by-default des qu'un Authorizer est branche ; les gardes echouent fermees ; l'outbox est signee sur un materiel canonique lie au tenant.

License

Apache-2.0