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

plyxen

v0.1.0

Published

Small helpers for driving a Chromium browser over the Chrome DevTools Protocol: page sessions, and a background network recorder with redaction.

Readme

plyxen

Small, dependency-light helpers for driving a Chromium-based browser over the Chrome DevTools Protocol. Two independent pieces:

  • plyxen — page/session helpers: list pages, connect, run a function against a page or the browser endpoint, and an optional Session that remembers the current page and can start the browser on demand.
  • plyxen/netlog — a background network recorder that writes JSON Lines and redacts sensitive headers/fields by default.

Built on chrome-remote-interface.

Install

npm install plyxen

Start a browser with remote debugging enabled, for example:

google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/cdp-profile about:blank

Sessions

import { listPages, withPage, Session } from "plyxen";

// Stateless helpers (default endpoint 127.0.0.1:9222)
const pages = await listPages();
await withPage(pages[0].id, async (client) => {
  await client.Page.enable();
  await client.Page.navigate({ url: "https://example.com" });
});

// A Session remembers the current page and can launch on demand
const session = new Session({
  endpoint: { port: 9222 },
  onLaunch: () => {
    // start your browser here (spawn the binary with --remote-debugging-port)
  },
});

await session.withPage(undefined, async (client, pageId) => {
  const title = (await client.Runtime.evaluate({ expression: "document.title" })).result?.value;
  return title;
});

API

  • listPages(endpoint?), listTargets(endpoint?), version(endpoint?)
  • isReachable(endpoint?), hasOpenPage(endpoint?)
  • connectPage(id, endpoint?) — you close it
  • withPage(id, fn, { endpoint?, autoDismissDialogs? }) — auto-closes; dialogs auto-accepted by default
  • withBrowser(fn, endpoint?) — connects to the browser-level endpoint
  • new Session({ endpoint?, onLaunch?, launchTimeoutMs?, autoDismissDialogs? }) with setCurrent / current / forget / listPages / connectPage / ensure / resolve / withPage / withBrowser

Endpoint defaults to 127.0.0.1:9222, overridable per call or via the CDP_HOST / CDP_PORT environment variables.

Network recording

Pass an already-connected page client; it records into a stream or file.

import { connectPage } from "plyxen";
import { NetworkRecorder } from "plyxen/netlog";

const client = await connectPage(pageId);
const rec = new NetworkRecorder(client);

await rec.start({ filter: "api", out: "./network.log" }); // JSON Lines, sensitive values masked
// ... drive the page ...
const { count } = await rec.stop();
await client.close();

Options: filter, failOnly, failStatus, successContains, failContains, redact (default true), sensitiveHeaders, and out (a writable stream or a file path to append to).

Redaction helpers are exported for reuse: redactHeaders, redactUrl, redactBody, and DEFAULT_SENSITIVE_HEADERS.

Even with redaction on, recorded traffic can contain private data. Treat the output as sensitive and keep it out of version control.

License

MIT