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

playcast

v0.0.2

Published

Record Playwright walkthroughs with zoom, keystroke overlays, and speed control

Readme

playcast

npm version npm downloads

Record a Playwright screencast with pinch-zoom, action annotations, and variable-speed segments. Output format is determined by the file extension — anything ffmpeg supports (.webm, .mp4, .gif, etc.).

Install

npm install playcast

Peer dependency: playwright (>=1.59.0, requires page.screencast API). ffmpeg is required at runtime for multi-segment recordings and non-.webm output formats.

Usage

import { chromium } from 'playwright';
import { create } from 'playcast';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');

const cast = create(page);
await cast.start('output.webm');

await cast.click(page.getByRole('button', { name: 'Sign in' }));
const email = page.getByRole('textbox', { name: 'Email' });
await cast.type(email, '[email protected]');

await cast.setSpeed(4); // fast-forward through loading
await page.waitForSelector('.dashboard');
await cast.setSpeed(1); // back to normal

const file = await cast.stop();
console.log(file); // "output.webm"

await browser.close();

API

create(page, options?)

Returns a playcast recorder bound to the given Playwright Page.

Options:

| Option | Default | Description | | ------------- | ------- | ------------------------------------------------------------- | | scale | 2.5 | Default pinch-zoom scale factor | | settleMs | 600 | Pause after zoom gesture (ms) | | zoomTo | false | Auto-zoom to elements on click() and type() | | showActions | {} | Options for Playwright's showActions, or false to disable | | typeDelayMs | 250 | Delay between keystrokes in type() (ms) | | timeout | 10000 | Timeout for element waitFor calls (ms) |

Recorder methods

start(path)

Begin recording. path is the output file path — the extension determines the format (e.g. 'demo.webm', 'demo.mp4', 'demo.gif').

stop(options?)

Stop recording and produce the final video. ffmpeg is used to combine segments and/or transcode to the output format when needed.

  • options.skipFFMpeg — if true, skip the ffmpeg combine step and just log the command.

click(locator, options?)

Click an element. When zoomed in, uses scroll suppression and force-click to prevent the page from jumping.

  • options.zoomtrue or zoom options object to zoom into the element before clicking.
  • options.showActions — override showActions for this click, or false to suppress the annotation.

type(locator, text, options?)

Type into an element character by character using pressSequentially. Playwright's showActions displays a "Type ..." annotation.

  • options.delayMs — per-character delay (default: typeDelayMs from create options).
  • options.zoomtrue or zoom options object to zoom into the element before typing.
  • options.showActions — override showActions for this type, or false to suppress the annotation.

zoom(target, options?)

Pinch-zoom into an element or region using CDP. target can be a Playwright Locator or a bounding box { x, y, width, height }.

  • options.scale — zoom factor (default: scale from create options).
  • options.settleMs — wait time after gesture.
  • options.relativeSpeed — gesture speed (default: 600).

zoomOut()

Reset zoom to 1x.

setSpeed(factor)

Change playback speed for subsequent recording. Creates a new segment — previous footage keeps its original speed.

pause() / resume()

Pause and resume recording. Anything that happens while paused is not captured.

Demos

Example recordings produced by the scripts in demos/:

Wikipedia search — type, click, zoomTo

basic

TodoMVC — type, click, zoom, zoomOut

todomvc

Hacker News — click, zoom, setSpeed, pause/resume

hackernews

Timing — pause, resume, setSpeed, showChapter

timing

Run them yourself with npm run demos or individually with npx tsx demos/basic.ts.

How it works

Playcast uses Playwright's page.screencast API to capture video as .webm segments. Each call to setSpeed() or pause()/resume() creates a new segment. When stop() is called, ffmpeg combines segments with per-segment setpts filters for speed adjustment and transcodes to the output format determined by the file extension.

Zoom is implemented via CDP Input.synthesizePinchGesture, with patches to prevent scrollIntoView and focus() from disrupting the zoomed viewport.

License

MIT