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

@praetorius/visual-regression-tester

v0.0.2

Published

Collects and compares screenshots of websites

Readme

Visual Regression Tester

Visual Regression Tester takes screenshots of a reference website and compares them with screenshots of a subject website. This can be used to automatically identify unintended visual changes introduced by updates or refactorings, for example:

  • switching the frontend build system (e. g. from webpack to Vite)
  • upgrading the content management system (e. g. from TYPO3 v12 to TYPO3 v13)

Visual Regression Tester encourages a workflow where the playwright test runner and the user collaborate on a shared report file. With each test run, the report is updated and refined.

The user can manually accept both passing and failing tests. Accepted tests are skipped in future runs. Over time, more tests become accepted: either because playwright verifies them automatically or because the user reviews and approves the remaining failures.

The goal is for every test to reach the accepted state.

Getting started

1. Initialize project

You can use the visual-regression-starter to setup your project:

git clone --depth=1 https://github.com/s2b/visual-regression-starter.git visual-regression-project
cd visual-regression-project
rm -rf .git && git init
npm install

2. Configure visual regression tester

Set the reference url (e. g. your production system) and the subject url (e. g. your development system) in visualregression.config.ts:

export default defineConfig({
  referenceUrl: "https://www.example.com",
  subjectUrl: "https://example.ddev.site",
});

See Config for all available configuration options.

3. Adjust playwright test file

A boilerplate test file is available in tests/visualregression.spec.ts, which should work out-of-the-box. However, depending on the features of the website you'd like to test, this file might need some adjustments, for example:

See also TestSnippets.md in the project directory.

Run tests

Variant 1: Use local browser binaries

  1. Install browser(s) with playwright install:
npx playwright install --with-deps firefox
  1. Run tests:
npx playwright test

Variant 2: Playwright server in docker

  1. Start playwright server in docker container:
docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.60.0-noble /bin/sh -c "npx -y [email protected] run-server --port 3000 --host 0.0.0.0"

(You might need to adjust the version numbers)

You can add the following argument to connect to the DDEV network:

--network ddev_default
  1. Run tests:
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/ npx playwright test

Review test results

Test results are collected in a report folder that contains screenshots of failed tests as well as a JSON report file named visualregression.report.json. That JSON file can either be processed manually or can be viewed and edited with the visual-regression-viewer:

npx @praetorius/visual-regression-viewer visual-regression-results/visualregression.report.json

(Note that, in contrast to other parts of this project, LLMs were involved in the creation of the viewer)