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

@wringer/browser

v0.1.2

Published

The browser driver for wringer: drives a page of a target's app in a headless browser

Readme

The browser driver for wringer: it drives a page of a target's app in a headless Chromium that the run keeps open between commands.

Install

bun add @wringer/core @wringer/browser
bunx playwright-core install chromium-headless-shell

The package runs on Bun 1.3 or newer. Pass executablePath to use a Chromium that is already installed.

Usage

import { browser } from '@wringer/browser';
import { createWringer, local } from '@wringer/core';

export const registry = createWringer({ name: 'shop' })
  .use(browser({ actionTimeoutMs: 10_000 }))
  .target('prod', {
    mode: 'attach',
    access: 'read-only',
    host: local(),
    endpoints: () => ({ web: 'https://shop.example' }),
    drivers: { browser: () => ({ readOnly: { allow: [{ role: 'button', name: 'Search' }] } }) },
  })
  .build();

An action calls ctx.drivers.browser, and the CLI adds the matching commands:

| Client call | Command | Effect | | ----------------------- | ----------------------------------------------- | ------ | | goto({ path }) | browser goto /cart | read | | snapshot() | browser snapshot | read | | describe({ ref }) | none | read | | click({ ref }) | browser click --ref e5 | write | | click({ role, name }) | browser click --role button --name Search | write | | type({ ref, value }) | browser type --ref e4 --value [email protected] | write | | screenshot() | browser screenshot | read |

The doctor check browser.launched fails when the browser has closed.

One second before a command's deadline, the driver starts to close the page under a browser action that is still running. When the page closes within half a second, the command fails with a timeout, and the driver opens a new page and tries to load the old page's URL in it, without the input the old page held. When that load fails, the new page stays blank until a browser goto. When the page does not close in that time, the action may still land: the command fails with an environment error, and the browser refuses every later command until up --restart.

A command that runs past its deadline answers only once the driver has answered for its cancelled action, so a timeout means the action stopped. When the run's supervisor gives no answer within 2 s of the deadline, such as on a host too busy to run the close, the command fails with an environment error, because the action may still land.

Snapshots and refs

snapshot prints the page as an accessibility tree, with a ref such as [ref=e5] on each element, and keeps it as evidence. A click or a type by ref acts on the element of the last snapshot, so take a snapshot after the page changes. screenshot keeps a PNG of the whole page as evidence.

Read-only targets

A read-only target refuses each click and type with exit code 3 and the target's hint, unless its readOnly.allow lists the element's role and exact name. The CLI cannot see a ref's role before it runs, so name a granted element by --role and --name on a read-only target.