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

zeroweight-renderer

v0.1.1

Published

Universal avatar rendering engine — use via CDN <script> tag or ES module import.

Readme

zeroweight-renderer

Universal avatar rendering engine. Framework-agnostic — use via CDN <script> tag or ES module import.

Installation

CDN (Script Tag)

<script src="https://unpkg.com/zeroweight-renderer/dist/zeroweight-renderer.umd.js"></script>

Or via jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/zeroweight-renderer/dist/zeroweight-renderer.umd.js"></script>

npm / yarn

npm install zeroweight-renderer

Quick Start

Via <script> tag

<canvas id="avatar" width="640" height="480"></canvas>

<script src="https://unpkg.com/zeroweight-renderer/dist/zeroweight-renderer.umd.js"></script>
<script>
  const { ZeroWeightRenderer, ActionQueue, VoiceActivityDetector } = window.ZeroWeightRenderer;

  const renderer = new ZeroWeightRenderer();
  const canvas = document.getElementById('avatar');

  // Init with your avatar bundle payload
  await renderer.init(canvas, { payload: bundleData });

  // Play actions
  renderer.play('speaking');
  renderer.play('wave_hand', 'listening'); // oneshot with fallback

  // Clean up
  renderer.destroy();
</script>

Via ES module

import {
  ZeroWeightRenderer,
  ActionQueue,
  VoiceActivityDetector,
} from "zeroweight-renderer";

const renderer = new ZeroWeightRenderer();
await renderer.init(canvas, { payload: bundleData });

API

ZeroWeightRenderer

The core rendering engine. Handles WASM initialization, canvas setup, render loop, and action management.

const renderer = new ZeroWeightRenderer();

| Method | Description | | --------------------------- | -------------------------------------------------- | | init(canvas, config) | Initialize with a canvas element and bundle config | | play(actionId, fallback?) | Play an action (e.g. "speaking", "wave_hand") | | interrupt() | Interrupt the current action | | destroy() | Clean up all resources |

| Property | Description | | ------------ | ---------------------------------------------------------------- | | state | Current state: "idle" | "loading" | "ready" | "error" | | isReady | true when engine is ready | | dimensions | Avatar intrinsic { width, height } |

Events: ready, actionLoaded, allActionsLoaded, dimensions, error, stateChanged

renderer.on("ready", () => console.log("Engine ready!"));
renderer.on("dimensions", (w, h) => console.log(`Avatar: ${w}x${h}`));

ActionQueue

Centralized action dispatch with turn-based queuing for speech synchronization.

const queue = new ActionQueue((actionId, fallback) => {
  renderer.play(actionId, fallback);
});

queue.dispatch("wave_hand"); // Execute or queue
queue.setTurnActive(true); // Start speaking turn
queue.setSpeechState("speaking"); // Update speech state
queue.forceListening(); // Reset to listening

VoiceActivityDetector

Amplitude-based VAD using Web Audio API with hysteresis for lipsync.

const vad = new VoiceActivityDetector({
  threshold: 0.008,
  speechStartFrames: 1,
  speechPauseFrames: 30,
  turnEndFrames: 50,
});

vad.on("speechStart", () => queue.setTurnActive(true));
vad.on("turnEnd", () => queue.setTurnActive(false));

vad.start(mediaStreamTrack);

Usage Tiers

| Tier | What you get | Use case | | ------------------ | -------------------------------------------------------------------------------------- | ------------------------ | | Tier 1 (Raw) | ZeroWeightRenderer only | Custom engine control | | Tier 2 (Queue) | + ActionQueue + VoiceActivityDetector | Speech-synced avatars | | Tier 3 (React) | zeroweight-renderer-react | Drop-in React components |

Build from Source

git clone <repo-url>
cd zeroweight-renderer
npm install
npm run build

Output in dist/:

  • zeroweight-renderer.umd.js — UMD bundle (script tag)
  • zeroweight-renderer.es.js — ES module
  • index.d.ts — TypeScript declarations

License

MIT