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

tests-reports-manager

v0.2.0

Published

Archive and compare test reports across runs (Playwright-first). Never lose yesterday's report again.

Readme

tests-reports-manager (trm)

Archive every test run instead of overwriting playwright-report/. Compare today's run to yesterday's. Browse runs in a local web UI.

Playwright-first, but works with any test runner (the playwright report just won't be parsed).

Install

npm install -D tests-reports-manager

Then in your project:

npx trm init

This creates .trmrc.json, ensures .test-reports/ exists, and adds it to .gitignore.

Quickstart

Wrap your usual test command:

npx trm run -- npx playwright test

Each call archives a new run under .test-reports/runs/<timestamp>__<sha>/ with:

  • manifest.json (metadata, summary, git info)
  • playwright-report/ (the full HTML report, untouched)
  • results.json (Playwright JSON reporter output)
  • tests.json (parsed test list)
  • stdout.log / stderr.log (full output)

Commands

| Command | What it does | |---|---| | trm init | Create .trmrc.json, init storage, update .gitignore | | trm run -- <cmd> | Run <cmd> and archive the resulting Playwright report | | trm list | Table of archived runs (newest first) | | trm diff [refA] [refB] | Compare two runs. Refs: latest, previous, run id, or short prefix. Defaults to previous latest | | trm serve [--port N] [--no-open] | Local web UI on 127.0.0.1:4789 | | trm open [ref] | Open the HTML report of a run in the default browser | | trm clean [--keep N] [ids...] | Apply retention or delete specific runs |

Web UI

npx trm serve
  • / lists every archived run with a one-click "Open report" link.
  • The dropdown lets you pick two runs and click Diff to jump to the comparison view.
  • Diff view shows counts of regressed, fixed, added, removed, flaky-changed, plus the list of tests whose status changed.
  • /tests.html lists every unique test seen across all runs, with its failure rate and ticket status. Filter by ticket status or "currently failing only".
  • /test.html?key=<test-key> shows one test: a timeline of pass/fail across runs and a form to attach a ticket (status, owner, linked URL, note) with full status history.

Per-test tickets

When a test fails, you usually want to document why and track its evolution. From /tests.html, click any test to land on its detail page and fill the ticket form. Status enum:

  • untriaged (default for new failures)
  • investigating
  • known-issue
  • flaky-env
  • bug-confirmed
  • fixed
  • wont-fix

Tickets are stored server-side in .test-reports/tickets.json (versioned with your other artifacts if you choose). They are visible to anyone hitting the trm serve URL, so the same data can be shared in CI by exposing the server.

Tickets are keyed by <file>::<spec title>. If you rename a test, its ticket points to the old key until you reattach it.

REST API:

GET    /api/tests                             # aggregated list
GET    /api/tests/history?key=<encoded>       # timeline of one test
GET    /api/tickets                           # all tickets
GET    /api/tickets/by-key?key=<encoded>      # one ticket
PUT    /api/tickets                           # body: { testKey, status, severity?, owner?, linkedTicketUrl?, note? }
DELETE /api/tickets?key=<encoded>             # remove a ticket

Configuration (.trmrc.json)

All fields optional:

{
  "storageDir": ".test-reports",
  "retention": { "keep": 30 },
  "playwright": {
    "reportDir": "playwright-report",
    "jsonReport": "results.json"
  },
  "server": { "port": 4789 }
}

retention.keep triggers automatic cleanup after each trm run. Set to 0 to disable.

How it works under the hood

trm run injects two env vars before spawning the test command:

  • PLAYWRIGHT_HTML_REPORT=.test-reports/runs/<id>/playwright-report
  • PLAYWRIGHT_JSON_OUTPUT_NAME=.test-reports/runs/<id>/results.json

So Playwright writes directly into the run folder. If your config writes to a fixed path instead, trm falls back to copying from playwright.reportDir after the run finishes.

stdout and stderr are tee'd to the terminal AND captured to log files - you see your tests run in real time, no buffering, exit code is preserved.

Programmatic API

import { runWrap, runList, runDiff, buildApp } from "tests-reports-manager";

await runWrap({ argv: ["npx", "playwright", "test"] });
const runs = runList();
const diff = runDiff({ refA: "previous", refB: "latest" });

Requirements

  • Node.js >= 18

License

MIT