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

visual-mirror

v1.1.0

Published

Pixel diffs tell you something changed. Visual Mirror tells you what it means.

Downloads

41

Readme

visual-mirror

Pixel diffs tell you something changed. Visual Mirror tells you what it means.

npm version license

A CLI tool for visual regression testing powered by AI. It captures a screenshot of a live URL, diffs it pixel-by-pixel against a reference image, then uses Claude Vision to provide an intelligent, human-readable analysis of what changed — complete with actionable fix suggestions.

Install

npm install -g visual-mirror

Quick Start

# Option 1: Paste from clipboard — just copy a screenshot and run:
visual-mirror --url http://localhost:3000

# Option 2: Provide a reference file:
visual-mirror --ref ./reference.png --url http://localhost:3000

How It Works

  1. Resolve — Checks the URL is reachable. If not, probes nearby ports (and common dev ports like 3000, 5173, 8080) and offers to use whichever one is live. Self-signed HTTPS is accepted so local dev servers Just Work.
  2. Capture — Takes a headless Chromium screenshot of your live URL via Playwright. If a login form is detected on the page, you're prompted to either log in (fields are auto-detected) or screenshot the login page as-is.
  3. Diff — Compares the captured screenshot against your reference image pixel-by-pixel using Jimp, generating a visual diff overlay
  4. Analyze — Sends both screenshots to Claude Vision, which identifies specific UI issues (not just "something changed" — it tells you what changed)
  5. Select — Presents issues in an interactive terminal prompt (like yay on Arch) where you pick which ones to get fix suggestions for
  6. Report — Generates a self-contained HTML report with all three images, issues, and fix suggestions, then auto-opens it in your browser

Usage

visual-mirror --ref <path> --url <url> [options]

Options

| Flag | Description | Default | |------|-------------|---------| | --ref <path> | Path to reference screenshot (PNG/JPG). If omitted, reads from clipboard | optional | | --url <url> | URL to capture and compare | required | | --width <number> | Viewport width in pixels | 1280 | | --height <number> | Viewport height in pixels | 720 | | --out <path> | Output directory for report | ./visual-mirror-report |

Example

visual-mirror --ref ./designs/homepage.png --url http://localhost:3000 --width 1440 --height 900

Login Detection

If the captured URL lands on a login screen, Visual Mirror detects the username, password, and submit selectors and asks whether you want to authenticate before the screenshot is taken:

  ⚙ Login screen detected.
    password field: #password
    user field:     input[name="email"]
    submit button:  button[type="submit"]

  ==> Log in before capturing? (y/N) y
  ==> Username / email: [email protected]
  ==> Password: ********
  ✔ Logged in successfully.

Decline the prompt to screenshot the login page as-is. Credentials are only used for the current run — nothing is stored on disk.

Interactive Flow

After analysis, you'll see something like:

  Severity: MINOR

  Issues found:
    1  Button alignment shifted 8px to the right          .cta-button
    2  Font color changed from #333 to #555               body
    3  Hero image 12px taller than reference              .hero-image

  ==> Select issues to get fix suggestions for (e.g. 1,2 or * for all)
  ==> 1,3

Then you'll get targeted fix suggestions:

  Fix suggestions:

  [1] Button alignment shifted 8px to the right
      → Check margin-right on .cta-button, likely a padding change.
        Try: padding-right: 16px;

  [3] Hero image 12px taller than reference
      → Set an explicit height on .hero-image: height: 320px;

  ✔ Report saved to ./visual-mirror-report/index.html
  Opening report...

Environment Setup

Visual Mirror uses the Claude API for analysis. If ANTHROPIC_API_KEY isn't set in your environment, you'll be prompted for one on first run and told how to persist it in your shell's rc file:

export ANTHROPIC_API_KEY="your-api-key-here"

Get one at console.anthropic.com.

Chromium is installed on-demand via Playwright the first time you run the tool — no manual setup required.

License

MIT