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

@intentic/browser

v1.248.0

Published

Drive a Chromium browser from Node over CDP — open pages, read them as structured text, click and type by element reference. No dependencies.

Readme

@intentic/browser

Drive a Chromium-family browser from Node over CDP: open pages, read them as structured text, and click and type by element reference. No dependencies.

import { browser } from "@intentic/browser";

const web = browser();
const page = await web.open("https://example.com/login");
// page.elements → [{ ref: "e0", role: "textbox", name: "Email" }, …]

await web.fill("e0", "[email protected]");
await web.fill("e1", "…", true);          // true = submit
const after = await web.snapshot();

Why references instead of coordinates

A browser can be operated by clicking pixels, and it is miserable: the coordinates move when the window moves, a scroll invalidates every one of them, and "the Submit button" is a guess about which grey rectangle is which.

A browser will simply tell you what it is showing. So this asks it: one snapshot returns every visible element with its role (link, button, textbox), its accessible name, and what it currently holds: and every action names an element rather than a position. The same instruction then works at any window size, on any machine, after any re-render.

Refs are deliberately short-lived. They index an array parked on the page, and the next snapshot replaces it, so a ref taken before a click that navigated cannot silently address whatever now occupies that slot. A stale ref fails loudly, which is the behaviour worth having.

Which browser it drives

Not the user's own. A browser only speaks CDP if it was started with --remote-debugging-port, and nobody's everyday browser was; restarting theirs to add the flag would close every tab they had open. So: if a debugging endpoint is already there, it is used; otherwise a separate instance starts with its own profile directory under ~/.intentic/host/browser.

That separate profile is a feature rather than a compromise. It is empty the first time, so the user signs into whatever is needed once, in a window they can watch, and it persists afterwards. Their own session is never automated and never at risk from a misfired click.

Why hand-rolled CDP rather than Puppeteer or Playwright

Not because Playwright is too heavy to ship. It bundles into the bun build --compile binary this ends up inside perfectly well: one --external chromium-bidi, for a require its own bundle makes and never resolves, and about 6 MB on top of a binary that already weighs ~95 MB. Anyone who assumes packaging is the obstacle will try it, watch it compile, and conclude this package exists for no reason.

It is that Playwright cannot reach a browser from Bun. chromium.connectOverCDP() fetches the debugger's WebSocket URL over HTTP, then stalls on the upgrade and times out thirty seconds later. That happens compiled and uncompiled alike, so it is the runtime rather than the bundling: and the same script against the same Chrome on Node drives the page and returns an accessibility snapshot. Bun's own global WebSocket, which is what this package is built on, connects from inside the compiled binary and gets a CDP reply back.

CDP needs no dependency either way. The protocol is JSON, fetch and WebSocket are globals, and the ~200 lines here are the subset that driving a page actually uses.

Worth re-testing rather than inheriting. The above was measured against playwright-core 1.62.1 on Bun 1.4.1. If a later pair connects, Playwright's accessibility snapshot is a better instrument than the DOM walk in snapshot.ts, and this whole package is ~500 lines: the trade would be worth making, not merely tolerable.

What is testable without a browser

snapshot.ts's renderer and ref parsing, and the per-platform browser search: all pure. The CDP calls end in a real Chrome painting a real page; those need a machine, not a test.

Key files