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

testgen-agent

v2.0.0

Published

Records and replays Playwright automation and sends API requests for TestGen, from your own machine.

Readme

testgen-agent

Records and replays Playwright automation and sends API requests for TestGen, from your own machine.

It replaces the two helpers that used to do this separately, testgen-recorder and testgen-api-agent. One process, one terminal.

Why this exists

TestGen runs on a server, and two things cannot happen there:

  • Recording a test means driving a real, visible browser. Servers have no screen.
  • Sending an API request from the API client has Postman's problem: a web page cannot call an arbitrary origin, and the platform's servers cannot reach a service on your localhost, your intranet, or behind your VPN.

So both happen here, on your machine, in a small process the web app talks to over loopback.

Install and run

npm install -g testgen-agent
testgen-agent

Leave that terminal open. The Record button lights up, and the API client's footer shows Agent: this machine.

Or, without installing anything permanently:

npx testgen-agent

The first run downloads the Chromium build its Playwright launches, which takes a minute — and again after an upgrade brings a newer Playwright. After that, startup is instant. Firefox and WebKit are only needed for the devices that ask for them; the app says so when you pick one.

Moving from testgen-recorder

Both listen on the same port, so stop the old one first:

npm uninstall -g testgen-recorder
npm install -g testgen-agent

Saved sign-ins live beside the installed package, so the first recording after the switch starts signed out.

What it does

It listens on 127.0.0.1:7337 and answers only the TestGen web app.

Recording. When you click Record, the app asks this process to open a browser; you click through your test; the resulting script goes back to the app and is stored against the test case. Play runs it again in a visible browser.

It also keeps the API calls the page made while you clicked — Playwright's own network log, read once the browser closes — so the app can offer them as a collection in its API client. Stopping from the app closes the browser the way Playwright does it, so that log is kept.

Sending. When you press Send in the API client, the app hands this process the request; it sends it with Node's own HTTP stack and returns the status, headers in arrival order, the body, the cookies the server set, and a timeline of every phase — DNS, connect, TLS, waiting, download. It keeps a cookie jar in memory, exactly like a browser would, and forgets it when it stops.

What it does not do

  • It is not reachable from the network. The listener binds to loopback only, so nothing outside your machine can connect to it — not your colleagues, not your network, not the internet.
  • It answers one origin. Requests are refused unless they come from the TestGen app itself. A page on any other site cannot use this to open a browser on your machine or send requests into your network, which is the whole reason the check exists.
  • It holds no credentials. It never sees your password or your API keys beyond the request you asked it to send.
  • It stores nothing. Scripts, collections, history and environments live in TestGen. A file in a form-data body arrives inside the request from the page; the agent is never told a path to open.

Self-hosting TestGen

If you run TestGen on your own domain, tell the agent which origin to accept:

TESTGEN_AGENT_ORIGINS=https://app.your-domain.com testgen-agent

Comma-separate several. Add only origins you control — this is the check that stops an arbitrary web page driving a browser on your machine.

To listen somewhere other than 7337:

TESTGEN_AGENT_PORT=7400 testgen-agent

The app looks on 7337, so change this only if something else already has that port. The older TESTGEN_RECORDER_ORIGINS and TESTGEN_RECORDER_PORT are still read.

Requirements

  • Node.js 20 or newer
  • A desktop OS with a display for recording — this cannot run on a headless server, which is the reason it is not simply part of the hosted app

Troubleshooting

The app still says the agent is missing. Check the terminal is still open and shows it listening. If you changed the port, the app will not find it.

"Port 7337 is already in use." The older testgen-recorder is probably still running. Close its terminal and start testgen-agent again.

The API client says the helper on this machine cannot send. That is the older testgen-recorder, which only records. Replace it with testgen-agent as above.

"That device needs a browser that is not installed." Run npx playwright install to fetch the missing engine.

It worked yesterday and now the app says the version is too old. Run npm install -g testgen-agent again and restart it.