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

mailfixture

v0.6.0

Published

Email, SMS, and webhook fixtures for test suites — programmatic inboxes, capture hooks, long-polling, and OTP extraction.

Readme

mailfixture

Email fixtures for your test suite. Create a programmatic inbox in one call, point your app's signup / OTP / password-reset flow at it, then wait for the email — parsed, with the OTP and links already extracted.

Receive-only, built for CI: long-polling instead of retry loops, zero runtime dependencies, TypeScript types included, Node 18+ (or anywhere with fetch).

npm install -D mailfixture

Quickstart

Create a key in Dashboard → API keys and export it as MAILFIXTURE_API_KEY.

import { test, expect } from "@playwright/test";
import { MailFixture } from "mailfixture";

const mfx = new MailFixture(); // reads MAILFIXTURE_API_KEY

test("signup sends a one-time code", async ({ page }) => {
  const inbox = await mfx.createInbox({ ttlSeconds: 900 });

  await page.goto("/signup");
  await page.fill("#email", inbox.emailAddress);
  await page.click("text=Send code");

  const otp = await inbox.waitForOtp({ timeout: 30_000 }); // long-polls; no sleep()
  await page.fill("#otp", otp);

  await expect(page.locator("h1")).toHaveText("Welcome");
});

Waiting for a magic link instead:

const link = await inbox.waitForLink({ kind: "verify", timeout: 30_000 });
await page.goto(link.url);

Capturing a webhook your app sends:

const hook = await mfx.createHook({ label: "checkout", ttlSeconds: 900 });
await configureAppWebhook(hook.ingestUrl); // your test setup
await triggerCheckout();
const request = await hook.waitForRequest({ match: "body:order.created" });
expect(request.method).toBe("POST");
await hook.delete();

The wait helpers long-poll server-side: the request is held open until a matching message arrives, or the timeout passes and a MailFixtureTimeout is thrown.

API surface

| Method | Purpose | | --- | --- | | createInbox({ localPart?, domain?, ttlSeconds? }) | new inbox; returns an Inbox handle | | inbox.waitForMessage({ match?, timeout? }) | first matching message, full body + extraction | | inbox.waitForOtp({ match?, timeout? }) | best extracted OTP as a string | | inbox.waitForLink({ kind?, match?, timeout? }) | first link, optionally verify\|reset\|unsubscribe | | inbox.messages({ since?, match?, wait? }) / clear() / delete() | raw listing & lifecycle | | getMessage(id), getOtp(id), getLinks(id) | direct message access | | downloadAttachment(messageId, index) | decoded attachment bytes | | createHook({ label?, ttlSeconds? }), listHooks() | webhook capture URL and lifecycle handles | | hook.waitForRequest({ match?, since?, timeout? }) | first matching captured request, including full headers and body | | hook.requests(...), clear(), delete() / getHookRequest(id) | capture listing, teardown, and direct detail access | | hookRequestBodyBytes(request) | exact body bytes (Uint8Array) for signature verification — handles the base64 branch for you | | createDomain(fqdn), verifyDomain(id), listDomains(), deleteDomain(id) | custom domains | | createKey(label?), listKeys(), revokeKey(id) | API keys |

match filters with subject:, from:, or to: prefixes; a bare term matches the subject. Timeouts are in milliseconds.

Capture-hook matching accepts method:, path:, and body:; a bare term matches the first 32 KiB of request body bytes. Returned detail bodies are complete.

Errors are thrown as MailFixtureError carrying the API's RFC 7807 status / title / detail fields.

Development

npm test   # builds ESM + CJS, runs the node:test suite

Docs: https://mailfixture.com/docs