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

@ochibi/runtime

v0.1.0

Published

Runtime for chibi scenes: zod schema, animation/state/interaction engine, and the <ChibiScene> React component.

Readme

@ochibi/runtime

Render and drive an exported chibi scene in any React app. This folder is the future npm package — it has no imports from the editor or the Next.js app (ESLint-enforced), so it can be extracted unchanged.

import { useRef } from "react";
import { ChibiScene, type ChibiSceneApi } from "@ochibi/runtime";

function Hero() {
  const api = useRef<ChibiSceneApi>(null);
  return (
    <>
      <ChibiScene
        src="/scenes/hero.chibi.zip"
        api={api}
        onEvent={(e) => console.log(e)}
        className="h-[600px]"
      />
      <button onClick={() => api.current?.transitionTo("st_hot")}>Hot</button>
      <button onClick={() => api.current?.play("an_float")}>Float</button>
    </>
  );
}

<ChibiScene> props

| Prop | Type | Default | Notes | |---|---|---|---| | document | unknown | — | Parsed scene JSON; validated (zod) on mount. Mutually exclusive with src (document wins). | | src | string | — | URL to a .chibi.json or .chibi.zip; fetched, sniffed (zip magic bytes), validated. | | resolveAsset | (asset) => Promise<string> | zip-bundled assets, else error | Maps an asset record ({ id, hash, name, … }) to a loadable URL. | | interactive | boolean | true | Pointer triggers (click / hover) active; click targets get cursor: pointer. | | orbit | boolean | false | User orbit around the scene camera. | | autoStart | boolean | true | Fire start triggers on mount. | | className / style | — | — | Sizing is the host's job; the canvas fills the box. | | fallback | ReactNode | null | Shown while the scene file loads. | | onEvent | (e: RuntimeEvent) => void | — | {type:"ready"} · {type:"interaction", trigger, action} · {type:"stateChange", nodeId, stateId}. | | api | Ref<ChibiSceneApi> | — | Imperative bridge (below). |

ChibiSceneApi: transitionTo(stateId, {duration?, ease?}) ("base" resets every stateful object) · play(animationId) · pause(animationId) · stop(animationId) · getState(){ [nodeId]: stateId } · setPaused(bool).

Also exported: loadDocument(urlOrBytes) (zip/json loader returning { doc, resolveAsset, dispose }), validateDocument, createDocument, InteractionRuntime (headless engine), and every schema type.

Behavior notes

  • Rendering is demand-driven. The canvas idles at zero frames; the engine wakes it when a transition/clip starts and it re-invalidates itself while motion is in flight. jszip is imported lazily — JSON-only consumers never download it.
  • ready fires after the document is mounted and start triggers ran. GLBs / textures may still stream in behind their own suspense boundaries.
  • Multiple instances on one page are independent — each owns its engine instance. (GLB parsing is cached per-URL across instances by drei's useGLTF, which is shared immutable data, not state.)
  • Text3D nodes need the font file served by the host at /fonts/helvetiker_regular.typeface.json (see react/Geometry.tsx).
  • Scene format reference: PRD §3.1. Documents are validated with zod; legacy (≤ M5) documents are migrated in-place by schema/migrate.ts.

Publishing

This is a real workspace package (packages/runtime), not just a folder of source — it has its own package.json, tsconfig.json, and tsup.config.ts. The editor/app still consume it at source level via the @/runtime/* tsconfig path alias, so no build is needed for local dev; building is only required to cut an npm release:

pnpm --filter @ochibi/runtime build     # emits dist/ (esm + cjs + d.ts)
cd packages/runtime && npm publish      # publishConfig.access is already "public"

Public surface: index.ts (curated) plus the editor-facing subpaths ./schema, ./engine, ./react/Geometry, ./react/SceneHost — everything else under src/ is internal. vitest run (root) covers packages/runtime/src with no editor code on the module graph, which is the self-containment proof.