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

@flatina/browser-ctl

v0.2.0

Published

CDP browser automation with accessibility-tree refs (@e1, @e2, …)

Readme

@flatina/browser-ctl

  • Zero-dependency browser automation package built on raw WebSocket CDP.
    • not a cli. Designed to be embedded in other tools (e.g. flmux).
  • Inspired by https://github.com/vercel-labs/agent-browser
  • Inspired by https://github.com/Ataraxy-Labs/agent-electrobun

Design

  • Zero dependencies — only Bun built-ins + WebSocket
  • CDPClient injection — both WebView and CDP support
  • Single-target — one Browser per page; multi-tab is the caller's concern

Core Concept: @ref

snapshot scans the accessibility tree, assigns @e1, @e2, ... references to interactive elements, then commands like click("@e1") resolve the ref to a real DOM node via backendDOMNodeId.

@e1 button "Sign In"
@e2 textbox "Email" value="[email protected]"
@e3 link "Forgot password?"
@e4 checkbox "Remember me" [checked]

Usage

import { Browser, CDPClient, discoverTargets, findTarget } from "@flatina/browser-ctl";

const targets = await discoverTargets("http://127.0.0.1:9222");
const target = findTarget(targets, t => t.url.startsWith("http"));
const client = await CDPClient.connect(target.webSocketDebuggerUrl);
const browser = new Browser(client, target.url, "/tmp/refs.json");

// Snapshot (with optional filtering — CSS or xpath=)
console.log(await browser.snapshot({ compact: true, selector: "#main" }));
console.log(await browser.snapshot({ selector: "xpath=//form[@id='login']" }));

// Interact
await browser.fill("@e2", "[email protected]");
await browser.click("@e1");
await browser.waitForLoad();
await browser.wait("xpath=//div[@class='success']");

// Query
const url = await browser.getUrl();
const visible = await browser.isVisible("@e3");

// Console capture
browser.captureConsole();
await browser.eval("fetch('/api')");
console.log(browser.logs()); // [{ level: "log", text: "...", timestamp }]

await browser.close();

API

| Category | Methods | |----------|---------| | Snapshot | snapshot(options?) with compact, selector (CSS or xpath=), roles filters | | Navigation | navigate back forward reload | | Interaction | click dblclick hover focus fill type press select check scroll | | Query | getText getHtml getValue getAttr getBox getUrl getTitle | | State | isVisible isEnabled isChecked | | Page | screenshot pdf eval | | Dialog | dialog("accept" \| "dismiss") | | Console | captureConsole logs | | Wait | wait(ms \| selector \| xpath=...) waitForLoad waitForNetworkIdle |

CDP Events

CDPClient exposes a typed event system with on/off/once:

client.on("Page.javascriptDialogOpening", (e) => {
  // e.type: "alert" | "confirm" | "prompt" | "beforeunload"
  browser.dialog("accept");
});

await client.once("Page.loadEventFired"); // Promise-based

License

MIT License