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

@arclabs561/ai-visual-test

v0.14.0

Published

Visual testing with vision language models

Readme

ai-visual-test

Review screenshots against a natural-language expectation with a vision model. It returns a score, issues, recommendations, and the provider/model used.

Install

npm install @arclabs561/ai-visual-test

Node 18 or newer is required. The Playwright integration also needs @playwright/test in your project.

Configure

.env files are loaded automatically. Set a provider and its API key:

VLM_PROVIDER=gemini
GEMINI_API_KEY=your-key-here

Supported providers are gemini, openai, claude, groq, and openrouter. Use ANTHROPIC_API_KEY for claude; the others use <PROVIDER>_API_KEY. VLM_MODEL or a per-call model option pins a model.

Optionally fail early in test setup:

import { validateStartup } from '@arclabs561/ai-visual-test';

validateStartup();

Review a screenshot

import { validateScreenshot } from '@arclabs561/ai-visual-test';

const result = await validateScreenshot(
  'checkout.png',
  'The payment form is readable, complete, and usable.',
  { provider: 'gemini' },
);

console.log(result.score);           // 0–10, or null when validation is disabled
console.log(result.issues);          // detected problems
console.log(result.recommendations); // suggested fixes

Integrations

| Need | Import | API | | --- | --- | --- | | Review a Playwright page | @arclabs561/ai-visual-test | validatePage(page, prompt, options) | | Add Playwright matchers | @arclabs561/ai-visual-test/playwright | createMatchers(expect) | | Add Vitest/Jest matchers | @arclabs561/ai-visual-test/vitest or /jest | createMatchers(expect) | | Compare before/after images | @arclabs561/ai-visual-test | validateComparison(before, after, prompt) |

For Playwright, call createMatchers(expect) once in test setup, then use expect(page).toHaveVisualScore(minimum, prompt) or expect(page).toBeAccessibleHybrid(minContrast). For Vitest or Jest, use expect(imagePath).toPassVisualCheck(prompt) or expect(imagePath).toHaveVisualScore(minimum, prompt).

validatePage captures a temporary screenshot; set fullPage, pass native screenshot options through screenshot, or set keepScreenshot: true when you need to inspect it.

Improve a downstream UI

@arclabs561/ai-visual-test/improvement reviews one caller-owned candidate against a captured baseline. Your project supplies the reversible adapter, deterministic gates, evidence projection, and evaluator:

import { runImprovementReview } from '@arclabs561/ai-visual-test/improvement';

const receipt = await runImprovementReview({
  objective, candidate, adapter, observer, projector, evaluator, evaluation,
});

After an apply attempt, the transaction invokes rollback and requires a fresh observation matching the baseline. A rollback failure throws and may require project-owned recovery. A preferred candidate returns review-required; the kernel never accepts or reapplies it.

The adapter, observer, projector, and evaluator are trusted in-process callbacks; this API does not sandbox them or choose a model provider. Replay identities combine kernel-derived evidence hashes with caller-attested candidate, projector, prompt-variant, and evaluator-configuration hashes. They support controlled comparisons only when those attestations are trustworthy. See the complete example for the full contract.

CLI

npx ai-visual-test check checkout.png "The payment form is usable" --min-score 7

Use --provider, --model, --json, or --verbose as needed. The command exits successfully only when the score meets --min-score.

Limits

  • Reviews require network access and a configured provider API key.
  • Scores are non-deterministic. Pin the provider and model, and use a stable prompt and cache when repeatability matters.
  • A score is a model judgment, not a replacement for functional or accessibility testing.
  • Provider/model capabilities, including multi-image and structured output, differ. Pin them when reproducibility matters.

License

MIT