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

giftuber

v0.1.0

Published

Renderer-agnostic avatar manifest utilities for GIFTuber assets.

Readme

giftuber

Renderer-agnostic utilities for loading and rendering GIFTuber avatar manifests.

GIFTuber renders avatar assets on a Canvas using GIF animations as the main visual source. A manifest can also include still image layers, such as mouth shapes and talk overlays, so applications can combine expressions, blinking, and lip sync without requiring Live2D, VRM, or a character rig.

日本語 README

Install

npm install giftuber

Usage

Web Speech API (zero setup)

import {
  createAvatarRenderer,
  createWebSpeechController,
  loadAvatarAssets,
  loadManifest,
} from "giftuber";

const manifest = await loadManifest("/avatar-assets/manifest.json");
const assets = await loadAvatarAssets(manifest);

const renderer = createAvatarRenderer({
  canvas: document.querySelector("canvas")!,
  manifest,
  assets,
});

renderer.setEmotion("happy");
renderer.start();

const speech = createWebSpeechController({ renderer });

speech.speak({
  text: "こんにちは。ブラウザの音声合成で話しています。",
  lang: "ja-JP",
  rate: 1,
  pitch: 1,
  volume: 1,
});

createWebSpeechController uses the browser's built-in speechSynthesis, so it can speak without an API key, local TTS server, or generated AudioBuffer. It drives mouth shapes from SpeechSynthesisUtterance boundary events when the browser provides them, and falls back to an estimated text timeline otherwise.

Use listVoices({ lang: "ja" }) to get a Promise-based voice list that also handles Chrome's initially empty speechSynthesis.getVoices() result.

Core renderer

import {
  buildMouthTimeline,
  createAvatarRenderer,
  createSpeechController,
  loadAvatarAssets,
  loadManifest,
} from "giftuber";

const manifest = await loadManifest("/avatar-assets/manifest.json");
const assets = await loadAvatarAssets(manifest);

const renderer = createAvatarRenderer({
  canvas: document.querySelector("canvas")!,
  manifest,
  assets,
});

renderer.setEmotion("happy");
renderer.start();

const speech = createSpeechController({ renderer });
const timeline = buildMouthTimeline("こんにちは", 1200);

speech.speakSilent(timeline, 1200);

The core renderer is framework independent. It only draws the current state given by the host application:

  • setEmotion(name | null) selects an idle expression, falling back to neutral when unset or unknown.
  • setSpeaking(boolean) switches between idle and speech rendering.
  • setMouthShape(shape) selects a mouth asset, falling back to mouth.neutral when the requested shape is unavailable.
  • start() and stop() control the requestAnimationFrame loop.
  • dispose() stops the loop and releases loaded ImageBitmap resources when possible.

loadAvatarAssets(manifest) preloads all image assets. GIF assets are decoded into timed frames before rendering.

VOICEVOX / AivisSpeech audio_query

import { buildMouthTimelineFromAudioQuery } from "giftuber";

const audioQuery = await fetch("/audio_query").then((response) =>
  response.json(),
);
const timeline = buildMouthTimelineFromAudioQuery(audioQuery);

await speech.speak({ audioBuffer, timeline });

buildMouthTimelineFromAudioQuery accepts the engine-independent shape used by VOICEVOX and AivisSpeech: accent_phrases[].moras[], pause_mora, prePhonemeLength, postPhonemeLength, and speedScale.

React

import {
  GiftuberAvatar,
  listVoices,
  useGiftuberAvatar,
} from "giftuber/react";
import { buildMouthTimeline } from "giftuber";

function Avatar() {
  const avatar = useGiftuberAvatar({
    manifestUrl: "/avatar-assets/manifest.json",
    emotion: "happy",
  });

  return (
    <>
      <canvas ref={avatar.canvasRef} />
      <button
        disabled={!avatar.ready}
        onClick={() =>
          avatar.speakSilent(buildMouthTimeline("Hello!", 900), 900)
        }
      >
        Speak
      </button>
      <button
        disabled={!avatar.ready}
        onClick={() =>
          avatar.speakWithWebSpeech({
            text: "こんにちは",
            lang: "ja-JP",
          })
        }
      >
        Speak with browser voice
      </button>
    </>
  );
}

function StaticAvatar() {
  return <GiftuberAvatar manifestUrl="/avatar-assets/manifest.json" />;
}

const japaneseVoices = await listVoices({ lang: "ja" });

Memoize rendererOptions before passing it to useGiftuberAvatar; a new object identity causes the hook to recreate the renderer.

Demo

npm run demo

Place a local avatar asset set at demo/avatar-assets/manifest.json. The demo/avatar-assets/ directory is ignored by Git so generated or private assets are not committed. The demo uses Web Speech API first, so a supported browser can speak aloud and drive mouth shapes without a local TTS server. Japanese voice availability and quality vary by browser and OS.

Manifest

The package currently supports GIFTuber Avatar Manifest v1 only. See docs/manifest-spec.md for the draft manifest contract.

License

MIT — see LICENSE.