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

@meldocio/snapwright

v0.1.6

Published

Persistent Playwright browser server with CLI control, auth persistence, and PNG compression

Readme

snapwright

npm version License: MIT Docs

A persistent Playwright browser server with CLI control, session persistence, and PNG compression.

Full documentation →

Designed for agent-driven screenshot workflows — start the server once, then send commands from scripts, AI agents, or the terminal.

Install

Global (recommended)

Install globally so the snapwright command is available system-wide — required for use with AI agents like Claude Code.

npm install -g @meldocio/snapwright
snapwright install-browsers

Verify:

snapwright --help

Local (per project)

npm install @meldocio/snapwright
snapwright install-browsers

Run via npx or the local binary:

npx snapwright start
./node_modules/.bin/snapwright start

CLI

Start the browser server

# Headless (default)
snapwright start

# Visible browser window
snapwright start --visible

# With persistent auth session
snapwright start --visible --auth .auth-state.json

# Custom port
snapwright start --port 9998

Control the browser

snapwright navigate https://example.com
snapwright click "button.submit"
snapwright fill "input[name=email]" "[email protected]"
snapwright hover ".dropdown-trigger"
snapwright scroll ".footer"
snapwright wait 1000

# Screenshots
snapwright screenshot output/home.png           # full page
snapwright screenshot output/btn.png ".button"  # clip to element

# Read the page
snapwright text       # visible text content
snapwright snapshot   # accessibility tree (JSON)
snapwright url        # current URL

# Auth
snapwright auth-save  # save cookies + localStorage to --auth file

# Stop
snapwright stop

Environment variables

| Variable | Default | Description | |---|---|---| | SNAPWRIGHT_PORT | 9999 | Server port | | HEADLESS | true | Set to false for visible browser |


Using with AI agents (Claude Code)

1. Install globally

The agent needs snapwright on PATH. Global install is the easiest way:

npm install -g @meldocio/snapwright
snapwright install-browsers

2. Install Claude Code skills

snapwright install-skills

Restart Claude Code. Two skills will be available automatically:

| Skill | What it does | |---|---| | snapwright | Navigate, click, read page content | | snapwright-screenshot | Take and save screenshots |

3. Start the server before your session

snapwright start --visible --auth .auth-state.json

The agent can now use snapwright commands via Bash. Example prompts:

"Navigate to the settings page and take a screenshot"

"Go to /projects, read what's on the page, then screenshot it"

"Click the Invite button and capture the modal"

Auth persistence

Log in once through the visible browser, then save the session:

snapwright auth-save

On all future snapwright start --auth .auth-state.json calls the session is restored automatically — no login required.


Programmatic API

import { BrowserServer } from '@meldocio/snapwright';

const server = new BrowserServer({
  port: 9999,
  headless: false,
  authFile: '.auth-state.json',
  outputDir: './screenshots',
  viewportWidth: 1440,
  viewportHeight: 900,
});

await server.start();
// listening on http://localhost:9999

await server.stop();

PNG compression

import { compressPng } from '@meldocio/snapwright/compress';

const stats = await compressPng('./screenshot.png');
// { original: 102400, compressed: 32768, saved: '100KB → 32KB (−68%)' }

License

MIT