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

p5-frame-capturer

v0.5.1

Published

Capture p5.js frames and saves into your local file system

Readme

p5-frame-capturer / Capture p5.js frames and saves into your local file system

npm version npm downloads license

[!WARNING] After v0.5.0, this package requires p5.js v2. Please use v0.4.2 or earlier if you want to use p5.js v1.

Demo: ESModule Mode (Source: /example) | UMD Mode

This is a simple tool to capture frames from a p5.js sketch and save them into your local file system.
It is useful for creating animations or exporting frames for further processing.\

[!WARNING] This package uses File System Access API, so it is only available in Chromium-based browsers.

Usage

Via script tag (UMD mode, For p5.js web editor)

  1. Include following script in your p5.js sketch:
<script src="https://cdn.jsdelivr.net/npm/p5-frame-capturer/dist/umd.js"></script>

Via bundler (ESModule mode, For using with bundlers like Vite)

  1. Install the package:
npm install p5-frame-capturer
  1. Import the package in your p5.js sketch:
import { p5FrameCapturer } from 'p5-frame-capturer';
import p5 from 'p5';

p5.registerAddon(p5FrameCapturer());
const p = new p5((sketch) => /* ... */);

API

Entire api is exported as a global variable window.p5FrameCapturer, or use ESModule import.

supportedImageFormats: string[]

List of supported image formats.

  • png
  • jpeg
  • webp
  • webpLossless

[!NOTE]
webpLossless uses wasm-based encoder, so it might be slower than other formats.

attachCapturerUi(p5Instance: p5)

Attaches the frame capturer UI to the p5.js sketch. On UMD build, this function is automatically called.

startCapturer(p5Instance: p5, options: Partial<Options>)

Starts capturing frames from the p5.js sketch.

Options

  • format: Image format to save the frames. Default: png.
  • frames: Number of frames to capture. You can use undefined or 0 to capture frames indefinitely until stopCapturing() is called. Default: undefined.
  • parallelWriteLimit: Maximum number of frames to write in parallel. You can use 0 to remove the limit, but this may cause your browser to crash. Default: 8.
  • onFinished: Callback function to call when capturing is finished. Will not be called if frames is undefined. Default: undefined.

stopCapturer()

Stops capturing frames.

state

Current state of the capturer.

  • isCapturing: Whether the capturer is capturing frames.
  • frameCount: Number of frames captured so far.
  • frames: Number of frames to capture, or 0 if capturing indefinitely.
  • fps: Frames captured per second.

Hints

  • You can use onEnd callback and ntfy.sh to get a notification when capturing is finished.
startCapturer(p, {
  onFinished: () =>
    fetch("https://ntfy.sh/your_topic_name", {
      method: "POST",
      body: "All frames are captured!",
      // This line is required to avoid CORS error
      mode: "no-cors",
    }),
});

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

The WebP encoder is built with Rust. The licenses of used crates are available in the NOTICE.md file.