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

@procyon-creative/procyon-vrt

v0.1.0

Published

Platform-agnostic visual regression testing harness built on Playwright. Parameterized pages/viewports, pluggable login, persisted auth with TTL.

Readme

procyon-vrt

Shared visual regression testing harness, platform-agnostic. Thin wrapper around Playwright's toHaveScreenshot() with:

  • Parameterized vrt.config.ts (pages × viewports)
  • Pluggable login middleware (WordPress, Drupal, anything — you write the callback)
  • Per-user persisted session storage with TTL + force-refresh
  • Playwright "project" integration (splice into your existing playwright.config.ts)

Install

npm install --save-dev @procyon-creative/procyon-vrt

If installing from a local path during development, set install-links=true in .npmrc to avoid symlink-dup issues with nested @playwright/test:

install-links=true

Config surface

Three files per consuming project:

1. tests/e2e/vrt.config.ts — what to screenshot

import type { VrtConfig } from '@procyon-creative/procyon-vrt';
import { admin, customer } from './vrt.login';

const config: VrtConfig = {
  logins: { admin, customer },

  pages: [
    { name: 'home', path: '/' },
    { name: 'about', path: '/about/', mask: ['.timestamp'] },
    { name: 'my-account', path: '/my-account/', auth: 'customer' },
    { name: 'admin', path: '/wp-admin/', auth: 'admin' },
  ],

  viewports: [
    { name: 'desktop', width: 1280, height: 800 },
    { name: 'mobile', width: 375, height: 667 },
  ],

  mask: ['#wpadminbar'],
  remove: ['.cookie-notice'],
};

export default config;

2. tests/e2e/vrt.login.ts — how to authenticate (platform-specific, you write it)

The package exposes a LoginDefinition interface — implement it for whatever CMS/framework you're on. Nothing is hardcoded.

WordPress:

import type { LoginDefinition } from '@procyon-creative/procyon-vrt';

export const admin: LoginDefinition = {
  name: 'admin',
  login: async (page) => {
    await page.goto('/wp-login.php');
    await page.fill('#user_login', process.env.WP_USER!);
    await page.fill('#user_pass', process.env.WP_PASS!);
    await page.click('#wp-submit');
    await page.waitForURL(/wp-admin/);
  },
  isValid: async (page) => {
    const resp = await page.goto('/wp-admin/', { waitUntil: 'domcontentloaded' });
    return !!resp?.ok() && !page.url().includes('wp-login.php');
  },
};

Drupal:

import type { LoginDefinition } from '@procyon-creative/procyon-vrt';

export const admin: LoginDefinition = {
  name: 'admin',
  login: async (page) => {
    await page.goto('/user/login');
    await page.fill('input[name="name"]', process.env.DRUPAL_USER!);
    await page.fill('input[name="pass"]', process.env.DRUPAL_PASS!);
    await page.click('#edit-submit');
    await page.waitForURL(/\/user\/\d+/);
  },
  isValid: async (page) => {
    const resp = await page.goto('/user', { waitUntil: 'domcontentloaded' });
    return !!resp?.ok() && !page.url().includes('/user/login');
  },
};

3. tests/e2e/vrt.spec.ts — one line

import { registerVrtTests } from '@procyon-creative/procyon-vrt';
import config from './vrt.config';

registerVrtTests(config);

4. Wire into Playwright — option A: single project in your existing config (recommended)

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
import { vrtProject } from '@procyon-creative/procyon-vrt';

export default defineConfig({
  // ... your existing config ...
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
      testIgnore: ['**/vrt.spec.ts'],
    },
    vrtProject({
      testDir: './tests/e2e',
      snapshotPathTemplate: './tests/e2e/vrt-snapshots/{arg}{ext}',
      authDir: './tests/e2e/.vrt-auth',
      use: {
        ...devices['Desktop Chrome'],
        baseURL: process.env.VRT_BASE_URL || 'https://example.lndo.site',
      },
    }),
  ],
});

Option B: standalone VRT config file

// playwright.vrt.config.ts
import { defineVrtPlaywrightConfig } from '@procyon-creative/procyon-vrt';

export default defineVrtPlaywrightConfig({
  testDir: './tests/e2e',
  authDir: './tests/e2e/.vrt-auth',
  fallbackBaseURL: 'https://example.lndo.site',
});

Run

# Project-based config:
npx playwright test --project=vrt
npx playwright test --project=vrt -g "home"           # grep by test title
npx playwright test --project=vrt --update-snapshots  # write baselines

# Force fresh logins (ignore TTL cache):
VRT_FORCE_LOGIN=1 npx playwright test --project=vrt

# Point at a different env:
VRT_BASE_URL=https://staging.example.com npx playwright test --project=vrt

Auth session caching

  • Persisted to {authDir}/{loginName}.json (Playwright storageState)
  • TTL: 12h default, configurable via authTtlMs in vrtProject() or VRT_AUTH_TTL_MS env
  • VRT_FORCE_LOGIN=1 bypasses cache entirely
  • Optional isValid(page) probe verifies restored sessions before using them — catches server-side invalidations that TTL alone can't detect
  • gitignore the auth dir; it contains session cookies

Per-page flags (VrtPage)

| Flag | Type | Purpose | |------|------|---------| | name | string | Test title + snapshot filename prefix | | path | string | URL path relative to baseURL | | auth | string \| false | Login name from config.logins (or false to force anonymous) | | before | (page) => Promise<void> | Run before screenshot (clicks, modals) | | mask | string[] | Selectors rendered as solid blocks | | remove | string[] | Selectors removed from DOM | | waitFor | string[] | Selectors to wait for before screenshot | | fullPage | boolean | Full page vs viewport (default true) | | element | string | Screenshot only this element | | delay | number | ms wait before screenshot | | skip / only | boolean | Skip / focus | | waitUntil | 'networkidle' \| 'load' \| … | Navigation strategy | | maxDiffPixelRatio / maxDiffPixels | number | Per-page tolerance |

Build

npm run build