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

@browserless/screencast

v10.9.18

Published

Capture website interactions frame-by-frame to create videos and GIFs. Perfect for demos, tutorials, and automated testing.

Readme

@browserless/screencast: Browserless video recording using puppeteer.

See the pdf section on our website for more information.

Install

Using npm:

npm install @browserless/screencast --save

About

This package provides frame-by-frame video capture from browser page navigation using the Chrome DevTools Protocol. It allows you to capture individual frames during page interactions for creating GIFs, videos, or frame-by-frame analysis.

What This Package Does

The @browserless/screencast package allows you to:

  • Capture frames during browser navigation and interactions
  • Control recording with start/stop methods
  • Process frames individually via callback functions
  • Configure quality and format for captured frames
  • Create animations like GIFs from captured frames

Usage

const createScreencast = require('@browserless/screencast')
const createBrowser = require('browserless')

const browser = createBrowser()
const browserless = await browser.createContext()
const page = await browserless.page()

const createScreencast = require('@browserless/screencast')
const createBrowser = require('browserless')

const browser = createBrowser()
const browserless = await browser.createContext()
const page = await browserless.page()

// Create screencast instance
const screencast = createScreencast(page, { 
  maxWidth: 1280, 
  maxHeight: 800 
})

// Collect frames
const frames = []
screencast.onFrame((data, metadata) => {
  frames.push({ data, metadata })
})

// Record during navigation
screencast.start()
await browserless.goto(page, { url: 'https://example.com' })
await screencast.stop()

console.log(`Captured ${frames.length} frames`)

API

createScreencast(page, options)

Creates a screencast instance for the given Puppeteer page.

Returns an object with:

| Method | Description | |--------|-------------| | start() | Begin capturing frames | | stop() | Stop capturing frames | | onFrame(callback) | Register frame handler |

Options

All options are passed directly to Page.startScreencast:

| Option | Type | Default | Description | |--------|------|---------|-------------| | format | string | 'jpeg' | Image format: 'jpeg' or 'png' | | quality | number | 80 | JPEG quality (0-100), ignored for PNG | | maxWidth | number | — | Maximum width of captured frames | | maxHeight | number | — | Maximum height of captured frames | | everyNthFrame | number | 1 | Capture every Nth frame |

Frame callback

The onFrame callback receives two arguments:

screencast.onFrame((data, metadata) => {
  // data: base64-encoded image string
  // metadata: { timestamp, ... }
})

| Argument | Type | Description | |----------|------|-------------| | data | string | Base64-encoded frame image | | metadata | object | Frame metadata including timestamp |

Examples

Create a GIF from navigation

const { GifEncoder } = require('@skyra/gifenc')
const { createCanvas, Image } = require('canvas')
const sharp = require('sharp')

const width = 640
const height = 400

const canvas = createCanvas(width, height)
const ctx = canvas.getContext('2d')
const encoder = new GifEncoder(width, height)

const screencast = createScreencast(page, { 
  maxWidth: width, 
  maxHeight: height 
})

screencast.onFrame(async data => {
  const frame = Buffer.from(data, 'base64')
  const buffer = await sharp(frame).resize({ width, height }).toBuffer()
  
  const img = new Image()
  img.src = buffer
  ctx.drawImage(img, 0, 0)
  encoder.addFrame(ctx)
})

encoder.start()
screencast.start()

await browserless.goto(page, { url: 'https://example.com' })

encoder.finish()
await screencast.stop()

Capture specific frames

const screencast = createScreencast(page, {
  format: 'png',
  quality: 100,
  everyNthFrame: 5  // Capture every 5th frame
})

screencast.onFrame((data, metadata) => {
  console.log(`Frame at ${metadata.timestamp}`)
  // Save or process the frame
})

Save frames to disk

const fs = require('fs').promises

let frameCount = 0

screencast.onFrame(async data => {
  const buffer = Buffer.from(data, 'base64')
  await fs.writeFile(`frame-${frameCount++}.jpg`, buffer)
})

screencast.start()
await page.goto('https://example.com')
await screencast.stop()

How it fits in the monorepo

This is an extended functionality package for video/animation capture:

| Consumer | Purpose | |----------|---------| | User applications | Creating GIFs, video recording, visual testing |

Dependencies

| Package | Purpose | |---------|---------| | null-prototype-object | Clean objects without prototype chain |

License

@browserless/screencast © Microlink, released under the MIT License. Authored and maintained by Microlink with help from contributors.

The logo has been designed by xinh studio.

microlink.io · GitHub microlinkhq · X @microlinkhq