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

widthwatch

v0.4.15

Published

Continuous responsive visual regression testing with adaptive viewport discovery

Readme

WidthWatch

Continuous responsive visual regression testing for Chromium. WidthWatch samples a width range, adaptively bisects intervals where the layout changes, detects deterministic layout failures, and emits typed objects plus a portable HTML report.

npx widthwatch https://example.com --output widthwatch.html --json widthwatch.json
npx widthwatch init

init creates widthwatch.config.ts and a reusable, read-only GitHub workflow. The config can hold scan defaults, comparison thresholds, output paths and application-specific pageReady logic without turning the CLI into a wall of flags.

import { scanAtReportSchedule, compareReports, generateHtmlReport } from "widthwatch";

const candidate = await scanAtReportSchedule(
  "http://localhost:4173",
  baseline,
  {
    pageReady: (page) => page.waitForSelector("[data-app-ready]"),
    readinessKey: "app-ready-v1",
  },
);

const comparison = compareReports(baseline, candidate, { maxDiffRatio: 0.002 });
const html = generateHtmlReport(comparison);

visual mode is the default. Adaptive scans first run a fast geometry discovery pass, then open a fresh page and capture full-page evidence only at the final schedule. maxSamples bounds discovery (24 by default) and maxCaptureSamples bounds expensive evidence (8 by default). Distinct finding identities are represented before remaining evidence slots are spent on transitions and width coverage. scanAtReportSchedule() reproduces both schedules for comparison.

The evidence pass waits for fonts, performs a bounded scroll sweep to activate lazy content and IntersectionObservers, returns to the top, and captures a full-page PNG. Use { mode: "layout" } for a faster single-pass viewport probe. Standalone diagnostic reports can opt into { imageFormat: "jpeg", imageQuality: 70 }; pixel comparisons intentionally require lossless PNG evidence. reloadPerWidth reruns page initialization at each width, while pageReady receives a phase of discovery or capture. Every hook requires a versioned readinessKey, which is stored in the report and checked during comparison.

Use maxRequestsPerNavigation to bound one page load and maxTotalRequests as a separate hard cap for the complete scan. Resources rejected by blockResourceTypes or allowedUrl do not consume those budgets.

Comparisons fail closed when widths, viewport dimensions, the rendering fingerprint, browser, platform, or PNG dimensions are incompatible. The capture protocol is versioned separately from the npm package, so a non-rendering patch release does not invalidate every baseline. comparison.valid explains whether a visual pass/fail decision is meaningful.

Reports group repeated findings into typed issueRanges, recording affected samples and adjacent clean samples without claiming exact unsampled boundaries. Comparison reports additionally expose new findings, resolved findings, severity escalated/deescalated changes, regression ranges and the exact pixel threshold used. Escalations enter regressions; de-escalations remain distinct from resolved findings. The HTML UI opens on the first regression and provides baseline, candidate and a truthful diff view when diff images were generated.

New reports expose optional sampling metadata, geometry probes, and a canonical issues union. frames contains only screenshot evidence. Each canonical issue identifies whether it was reproduced during capture or observed only during discovery. These fields remain optional on schema-v1 objects so existing report producers stay source-compatible.

The published package supports Node.js 22 and 24.

The hosted demo accepts only public HTTP(S) pages and applies separate safety limits. The local package intentionally gives the caller more control; do not scan untrusted URLs from a privileged network without an egress policy.