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

mumford

v2.0.0

Published

I Will Wait (for You) as a tiny abortable polling toolkit.

Readme

mumford

I Will Wait (for You), but only as a tiny abortable polling toolkit.

mumford is a small Node-first utility for waiting on async conditions without dragging in a heavy dependency tree. It gives you two promise-native primitives:

  • waitFor for readiness checks
  • repeatUntil for running work until the result is acceptable

No legacy chaining. No global queue. No runtime dependencies.

Install

npm install mumford

Node >=20 is supported.

waitFor

Use waitFor when you already have a condition and just need to keep checking until it becomes true.

import { waitFor } from "mumford";

await waitFor(async () => {
    const response = await fetch("http://localhost:3000/health");
    return response.ok;
}, {
    interval: 100,
    timeout: 5_000,
});

options

  • interval delay in milliseconds between settled attempts. defaults to 50.
  • timeout total wall-clock timeout in milliseconds. defaults to Infinity.
  • signal optional AbortSignal for cooperative cancellation.

The first attempt starts immediately. Only one attempt is ever in flight at a time.

repeatUntil

Use repeatUntil when you want to run work repeatedly and stop once the returned value passes a predicate.

import { repeatUntil } from "mumford";

const record = await repeatUntil(
    async () => {
        const response = await fetch("http://localhost:3000/jobs/latest");
        return response.json() as Promise<{ status: string }>;
    },
    {
        interval: 250,
        timeout: 10_000,
        until: (value) => value.status === "done",
    },
);

repeatUntil resolves with the final task result, not a wrapper around it.

Timeouts, aborts, and failed attempts

  • timeout: Infinity means polling can continue indefinitely.
  • thrown or rejected check() / task() calls are treated as failed attempts and retried.
  • thrown or rejected until() calls are treated as real errors and reject immediately.
  • aborts reject immediately, including between attempts.

Timeouts reject with WaitTimeoutError, which includes:

  • attempts
  • elapsedMs
  • lastError
  • cause

A little more than this

import { WaitTimeoutError, waitFor } from "mumford";

try {
    await waitFor(() => false, { timeout: 250 });
} catch (error) {
    if (error instanceof WaitTimeoutError) {
        console.error(error.attempts, error.elapsedMs, error.lastError);
    }
}

Migration from mumford 0.x

This is a clean break from the old when().then() and doUntil().then() API.

before

when(isReady).then(function () {
    startApp();
});

after

await waitFor(isReady);
startApp();

For repeated async work, replace doUntil() with repeatUntil().

Licence

MIT