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

gltf-interactivity

v0.4.2

Published

KHR_interactivity glTF graph <-> code transpiler: decompile graphs to TypeScript/Lua/Python/C#/GDScript, compile them back, verify, and run them.

Readme

gltf-interactivity

Transpiler between KHR_interactivity glTF behavior graphs and ordinary code. Decompile a graph into TypeScript, Lua, Python, C# or GDScript, edit it like a program, and compile or splice it back into the asset. Also ships a verifier and a reference interpreter.

Requires Node >= 22.

Install

npm i gltf-interactivity                  # runtime, ir, gltf, verify, emit/*, parse/{py,cs,gd}
npm i gltf-interactivity ts-morph         # + TypeScript parsing (parse/ts; CLI compile/apply/roundtrip with ts)
npm i gltf-interactivity luaparse         # + Lua parsing (parse/lua; CLI --lang lua apply/roundtrip)

ts-morph (^23) and luaparse (^0.3.1) are optional peer dependencies: they are only needed to parse TypeScript / Lua, so installing the package for the runtime, IR or verifier does not pull in a TypeScript compiler. gltfi decompile / extract need neither. If a parser peer is missing, the CLI prints this command needs the optional peer dependency ts-morph and exits 1. When importing gltf-interactivity/parse/ts or gltf-interactivity/parse/lua as a library without the peer installed, the import itself fails with ERR_MODULE_NOT_FOUND for that package; no other entry point loads them.

The ./runtime entries re-export @gltfi/runtime, which is a regular dependency (the CLI uses it too, so there is a single interpreter implementation).

CLI

npm install -g gltf-interactivity     # or: npx gltfi ...

gltfi decompile <in.glb|in.gltf> [-o out.ts] [--js] [--graph N]
gltfi compile <in.ts> [-o out.gltf|out.glb] [--merge-into base.glb]
gltfi extract <in.glb|in.gltf> [-o out] [--lang ts|lua|py|cs|gd] [--graph N] [--force]
gltfi apply <asset.glb|asset.gltf> <script> [--graph N] [--lang ts|lua|py|cs|gd] [--dry-run] [--backup]
gltfi roundtrip <in.glb|in.gltf> [--graph N]
gltfi verify-equal <a.gltf|a.glb> <b.gltf|b.glb> [--graph-a N] [--graph-b N]

extract / apply is the byte-preserving edit workflow: gltfi extract asset.glb writes a script beside the asset; after editing it, gltfi apply asset.glb asset.ts splices the edited graph back in, leaving every byte outside extensions.KHR_interactivity.graphs[N] untouched.

The gltfi conform subcommand (Khronos conformance runners) is only available from a repository checkout; it needs the Khronos test assets.

Toolchain requirements

| Language | Emit | Parse (apply, roundtrip) | |---|---|---| | ts, lua, gd | none | none beyond the optional peers ts-morph (ts) / luaparse (lua); gd is pure JS | | py | none | python3 on PATH | | cs | none | .NET 8 SDK (dotnet on PATH); the C# AST harness is built into the package's src/cs/bin on first use, so that directory must be writable |

Library

Everything is ESM, with types.

import { importGraph, exportGraph, checkModule } from "gltf-interactivity/ir";
import { emitModule } from "gltf-interactivity/emit/ts";
import { parseModule } from "gltf-interactivity/parse/ts";
import { validateGraph } from "gltf-interactivity/verify";
import { parseContainer, writeGlb } from "gltf-interactivity/gltf";
import { createRuntime } from "gltf-interactivity/runtime";

| Subpath | Contents | |---|---| | . | re-exports ir, gltf and verify | | ./ir, ./gltf, ./verify | graph IR + import/export, glTF/GLB container + splice, graph validation | | ./runtime, ./runtime/node | re-exports of @gltfi/runtime / @gltfi/runtime/node (reference interpreter; node adds GLB file loading) | | ./emit/{ts,lua,py,cs,gd} | IR to source | | ./parse/{ts,lua,py,cs,gd} | source to IR (ts needs the ts-morph peer, lua the luaparse peer) |

Validation: validateGraph(graph) / validateExtension(ext) (./verify) implement the spec's Validation section and return diagnostics (code, message, section, path, nodeIndex, outcome). importGraph and the runtime entry points (resolveGraph, createRuntime, InteractivityRuntime) run the same validation at load and throw InteractivityValidationError (carrying diagnostics) for an invalid graph or extension (show reasons from diagnostics — code, message, path, nodeIndex — not by parsing the error message), so nothing is imported, emitted or run from invalid input. Pass { validate: false } to importGraph to opt out.

Dependency: @gltfi/runtime. Optional peers: ts-morph, luaparse.

Compiled engines (the output of decompile) import their runtime from @gltfi/runtime-lib.

License

MIT