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

@amykit/workflow-testkit

v0.6.0

Published

The tests every workflow needs and nobody writes, driven against a world its author supplies.

Readme

@amykit/workflow-testkit

The tests every workflow needs and nobody writes.

Not a plugin. A library a workflow's own test suite imports, so the half of a workflow that is the same in every workflow — the machine-shaped half — is proven by the same suite everywhere, from the first commit.

What it checks

A workflow is two halves. The domain — which states exist, what each one means, when work moves — is the author's, and no harness can check it. The other half is identical in every workflow anybody will write:

| Property | What goes red | | :-- | :-- | | every state is reachable, and every state has a way out | a declared state no world reaches, one every world leaves the work in, a lifecycle that never comes to rest | | every action it plans has a handler that survives being called | a key in the runtime's actions with nothing behind it, a port-and-method whose port the world did not hand over, an action planned that the runtime never declared, or one throwing on the observation the runtime really built | | a wait does not spend the ceiling that decides when to give up | a waiting state that gives up after enough looks at an unchanged world, or a hold counted against the attempts of the work after it | | an empty collection concludes nothing | a decision that rests on [].every(...) being true | | giving up has a way out, and only one | a giving-up state that is terminal, or one left before the world moved |

Each finding names the state, the action or the world to go and look at.

Use it

import { describe, it } from "node:test";
import { conforms } from "@amykit/workflow-testkit";
import { workflow, runtime } from "./index.js";

conforms(workflow, {
  runner: { describe, it },
  runtime: (world, now) => runtime(world.ports(now)),
  // Only needed for an action declared as { port, method }: the fakes the
  // host would otherwise hand over, by port kind.
  ports: (world) => ({ tracker: world.tracker }),
  worlds: [aFreshTicket(), aTicketInReview(), aTicketNobodyTriaged()],
});

That registers one ordinary test per property in whichever runner you hand it — node:test, vitest, jest. conformance(workflow, options) is the same walk returning the findings instead, for asserting on one.

amy workflow new writes this call into the scaffold, so a workflow has it before it has anything else.

A world is yours

The kit never invents one. A world is one situation the workflow can be in, carrying the fake ports your runtime is built from:

interface World {
  name: string;                 // named in every finding
  workId?: string;              // what newRecord is given; the name otherwise
  start?: (now: Date) => Record; // a record to start from; newRecord otherwise
  meanwhile?: (() => void)[];   // what the world does, one step per wait
}

The kit drives your runtime against it the way the engine does: observe, plan, call every action the plan carries — a handler directly, a port-and-method on the port ports handed over — and fold, telling the fold which move it made. The world moves only while the machine waits, one meanwhile step each time, so a state that moves on without one having run moved on something that was already there.

A harness that stubs the domain proves the stub. A fake that ignored the argument the real port maps over once let a handler hand it undefined and still go green — which is why the kit calls handlers with the observation your runtime built, against ports you wrote.

Licence

MIT