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

flow-weave

v4.1.0

Published

`flow-weave` is a TypeScript workflow toolkit with one runtime model and two authoring styles:

Readme

flow-weave

flow-weave is a TypeScript workflow toolkit with one runtime model and two authoring styles:

  • fluent builder authoring
  • decorator authoring

It supports typed flow definitions, branching and iteration, runtime execution with stop propagation, and optional saga compensation.

Installation

npm install flow-weave

Package Entrypoints

  • flow-weave: main app/runtime entry
  • flow-weave/builder: advanced fluent-builder APIs
  • flow-weave/decorator: core flow decorators
  • flow-weave/saga: saga plugin, saga runtime/types, and saga decorators

Upgrading from the previous package surface? See the v4 migration guide.

In normal app code, start with FlowWeave from the root package.

Choose Your Style

Builder

import { FlowWeave } from "flow-weave";

type Ctx = {
  value: number;
  logs: string[];
};

const app = FlowWeave.create().build();
const weaver = app.weaver();

const flow = weaver
  .flow<Ctx>("basic-flow")
  .task((ctx) => {
    ctx.value += 1;
    ctx.logs.push("increment");
  })
  .task(async (ctx) => {
    await Promise.resolve();
    ctx.logs.push(`value:${ctx.value}`);
  })
  .build();

await app.runtime().createFlowExecution(flow, {
  value: 0,
  logs: [],
}).start();

Decorator

Decorator authoring uses TC39 Stage 3 decorators.

import { FlowWeave, IFlowDef } from "flow-weave";
import { Flow, Task } from "flow-weave/decorator";

type Ctx = {
  value: number;
  logs: string[];
};

@Flow<Ctx>("basic-flow")
class BasicFlow {
  declare static readonly flowDef: IFlowDef<Ctx>;

  @Task()
  static increment(ctx: Ctx) {
    ctx.value += 1;
    ctx.logs.push("increment");
  }
}

const app = FlowWeave.create().build();

await app.runtime().createFlowExecution(BasicFlow.flowDef, {
  value: 0,
  logs: [],
}).start();

Saga

Saga support is optional and lives in flow-weave/saga.

import { FlowWeave } from "flow-weave";
import { sagaPlugin } from "flow-weave/saga";

const app = FlowWeave.create().use(sagaPlugin).build();

Use flow-weave/saga for:

  • sagaPlugin
  • SagaDef, SagaExecution, saga status/types
  • saga decorators like @Saga, @CompensateWith, and @CommitPoint

What You Can Model

  • task steps
  • delay steps
  • child-flow composition
  • try/catch flow blocks
  • parallel branches
  • switch-style routing
  • sequential and parallel iteration
  • hooks, retry, and recovery
  • saga compensation and commit points

Documentation

Examples

  • npm run example:core -> examples/basic-flow.ts
  • npm run example or npm run example:saga -> examples/checkout-saga.ts
  • npm run example:advanced -> examples/branching-and-iteration.ts

Local Development

npm run typecheck
npm test
npm run build
npm run example:core
npm run example
npm run example:advanced