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

@vectojs/video-exporter

v0.4.0

Published

Video export utility for VectoJS

Readme

@vectojs/video-exporter

Deterministic video export for VectoJS scenes: a CLI (vecto-export) and an exportVideo() API that drive a page's scene in headless Chromium one fixed time step at a time — stopping the normal Scene clock and advancing exactly 1000 / fps ms per frame — then capture the canvas as PNG frames and pipe them to FFmpeg for H.264 MP4 encoding. It is a standalone tool package: it depends on Puppeteer, Vite, and FFmpeg rather than on other @vectojs/* packages, so any project (or CI job) can render VectoJS animation time reproducibly.

Install

bun add @vectojs/video-exporter

Requires FFmpeg with the libx264 encoder as ffmpeg on PATH, plus Chromium resolved from PUPPETEER_EXECUTABLE_PATH, then /usr/bin/chromium, then Puppeteer's configured or bundled browser. Vite is installed automatically as a runtime dependency for local entries.

Usage

// In the exported page: expose a startable Scene as window.vectoScene.
const scene = new Scene(document.querySelector('canvas')!);
window.vectoScene = scene;
scene.start();

// From Node/Bun:
import { exportVideo } from '@vectojs/video-exporter';

await exportVideo({
  url: './my-animation.ts', // local module or HTTP(S) URL
  outputPath: './out.mp4',
  width: 1920,
  height: 1080,
  fps: 60,
  duration: 10,
  audioPath: './voice.wav', // optional: muxed as AAC, trimmed to the video length
});

The fixed-step contract makes VectoJS animation time deterministic: the exporter calls the optional reset() on window.vectoScene right after stopping the clock (so scenes carrying load-time wall-clock state return to their t=0 presentation), then steps and captures Math.ceil(fps * duration) frames. Application code using unrelated clocks, network input, or unseeded randomness can still vary.

Highlights

  • Fixed-step scene control — scene.step(1000 / fps) before each capture, never wall-clock time; output is standard H.264 yuv420p MP4.
  • CLI accepts a local JavaScript/TypeScript module (served through an in-memory Vite route that writes nothing into your source directory) or an already-hosted URL: bunx vecto-export ./scene.ts -o out.mp4 -w 1920 -h 1080 -f 60 -d 5.
  • Optional audio: -a/--audio <file> (or audioPath in the API) muxes an audio track as AAC, trimmed to the video length; exports stay silent without it.
  • Atomic output: FFmpeg encodes to a unique staged file beside the destination, which replaces the target only after a successful exit; failed or aborted exports preserve any existing file and remove the staged one.
  • Errors identify the failing phase — validation/Vite, Chromium/page contract, capture, FFmpeg spawn/stdin/exit, output commit, cleanup — with a bounded FFmpeg stderr tail attached.
  • Cancellation end to end: AbortSignal on API exports, SIGINT/SIGTERM mapped to the same path in the CLI (exit codes 130/143); every acquired resource is released in reverse order.
  • The Chromium sandbox stays enabled for normal users and is disabled only for root or with explicit VECTO_CHROMIUM_NO_SANDBOX=1, warning either way.
  • Frame-0 determinism support (#646): page load free-runs rAF before capture begins, so scenes with load-time state should expose reset(); static-until-first-step scenes need nothing.

Documents @vectojs/[email protected].

Documentation