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

record-trace

v0.3.0

Published

Record Chrome DevTools Performance traces over CDP, streamed to disk

Readme

record-trace

Record Chrome DevTools Performance traces from the command line. You interact with the page yourself (or script it), and get a trace you can load into the DevTools Performance panel.

  • Uses the same trace categories as the DevTools Performance panel, plus JS sampling and screenshots.
  • Streams the trace to disk in chunks, so long recordings don't run out of memory.
  • Can embed source maps into the trace metadata, so DevTools shows original function names.
  • No dependencies. Needs Node 22+.

Setup

Install Chrome for Testing once:

mkdir -p ~/.cache/puppeteer && cd ~/.cache/puppeteer && npx -y @puppeteer/browsers install chrome@canary

Usage

npx record-trace https://example.com

Chrome opens. Get the page ready, press Enter, pick a tab, press Enter to start, interact with the page, then press Enter to stop. The trace is saved to ./trace-<timestamp>.json. Load it into DevTools from Performance → Load profile.

Non-interactive (from scripts or agents):

npx record-trace --tab example --seconds 10 --source-maps
npx record-trace --url https://example.com --throttle 4 --out load.json   # page-load trace
npx record-trace --headless --scenario ./type-text.mjs --lean           # scripted interaction

| Option | | | -------------------- | ---------------------------------------------------------------------------------------------------------- | | --tab <text> | Record the tab whose URL or title contains text (default: the first tab) | | --seconds <n> | Stop after n seconds (otherwise stop on SIGINT/SIGTERM) | | --url <url> | Navigate the tab and wait for load before recording | | --scenario <file> | Run a CDP script while recording; recording stops when it resolves (see below) | | --init-script <js> | Run in every frame before page scripts (Page.addScriptToEvaluateOnNewDocument) | | --throttle <n> | Throttle the CPU by n× while recording | | --source-maps | Embed source maps into the trace metadata (fetched with the page's cookies) | | --selector-stats | Include CSS selector stats | | --lean | Skip script sources and screenshots, for a much smaller trace. Metrics and the CPU profile are unaffected. | | --out <file> | Output path | | anything else | Passed to Chrome, e.g. --headless |

| Env | Default | | --------- | ------------------------------------------------------------------------- | | CHROME | Newest Chrome for Testing in ~/.cache/puppeteer | | PORT | 9222 | | PROFILE | ~/.cdp-trace-chrome (the user data dir, so logins persist between runs) |

In interactive mode, press s, m or t to toggle selector stats, source maps or 4x CPU throttling; Enter starts/stops recording, q quits.

Scenarios

A scenario is a module that drives the page over the Chrome DevTools Protocol while the trace is recording:

// type-text.mjs
export default async ({ send, waitFor }) => {
  await send("Runtime.evaluate", { expression: 'document.querySelector("textarea").focus()' });
  for (const ch of "hello") {
    await send("Input.dispatchKeyEvent", { type: "char", text: ch });
  }
  await new Promise((r) => setTimeout(r, 1000));
};

send(method, params) sends a CDP command to the tab. waitFor(eventName) resolves with the params of the next event with that name.

Sharing the browser

If Chrome is already listening on PORT, record-trace attaches to it and leaves it running when it exits. That means you can use it alongside chrome-devtools-mcp with --browserUrl http://127.0.0.1:9222.

Agent skill

The package includes a skill that teaches coding agents to record traces with record-trace.

Claude Code:

/plugin install record-trace --marketplace d4rkr00t/record-trace

Other agents: link the skill from the installed package into the agent's skills directory, so it stays in sync with the CLI version:

ln -s "$(npm root -g)/record-trace/skills/record-trace" ~/.agents/skills/record-trace

Limits

  • DevTools reads the whole trace file into a single string, which V8 caps at about 536 MB, so larger files won't load. record-trace warns when this happens. Record a shorter window, or use --lean.
  • Chrome's trace buffer is set to 2 GB. If it fills up, Chrome drops events and record-trace prints a warning.