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

@ui2v/producer

v1.0.9

Published

System-browser MP4 rendering pipeline for ui2v using Canvas and WebCodecs

Readme

@ui2v/producer

English

基于本机系统浏览器的 ui2v 预览和 MP4 渲染管线。

@ui2v/producer 会启动本地静态服务器,通过 puppeteer-core 控制本机 Chrome、Edge 或 Chromium,加载已构建的 ui2v bundle,通过 Canvas 渲染每一帧,用 WebCodecs 编码 MP4,并由 Node.js 写出结果文件。

安装

npm install @ui2v/producer

环境要求

  • Node.js 18 或更新版本
  • 本机已安装的 Chrome、Edge 或 Chromium
  • 浏览器支持 WebCodecs MP4 导出

安装依赖时不会下载内置浏览器。如果自动检测失败,可以设置 PUPPETEER_EXECUTABLE_PATHCHROME_PATHCHROMIUM_PATHEDGE_PATH

渲染到文件

import { readFile } from 'node:fs/promises';
import { parseProject } from '@ui2v/core';
import { renderToFile } from '@ui2v/producer';

const project = parseProject(await readFile('animation.json', 'utf8'));

const result = await renderToFile(project, 'output.mp4', {
  quality: 'high',
  codec: 'avc',
  onProgress(progress) {
    console.log(`${progress.phase}: ${Math.round(progress.progress)}%`);
  },
});

if (!result.success) {
  throw new Error(result.error);
}

预览

import { startPreview } from '@ui2v/producer';

const session = await startPreview(project, { headless: false });
console.log(session.url);
await session.close();

预览页包含左侧 JSON 项目库、时间线控制、播放速度、适配/剧场/全屏模式、debug overlay、PNG 快照导出、可复制 CLI 渲染命令和 Export MP4 按钮。快捷键:Space 播放/暂停,f 全屏,t 剧场模式,d debug。通过 CLI 启动时,导出文件会写入 .tmp/examples

浏览器发现

import {
  checkBrowserEnvironment,
  findBrowserExecutable,
  resolveBrowserExecutable,
  resolveRequiredBrowserExecutable,
} from '@ui2v/producer';

console.log(resolveBrowserExecutable());
console.log(findBrowserExecutable());
console.log(resolveRequiredBrowserExecutable());
console.log(await checkBrowserEnvironment());

checkFFmpeg 仍作为旧调用方的兼容别名保留。新代码应使用 checkBrowserEnvironment

许可

MIT