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

@huggingface/usd-web-viewer

v0.2.1

Published

OpenUSD viewer for the web: pure-Rust USD composition (openusd) in WASM, rendered with three.js

Readme

@huggingface/usd-web-viewer

OpenUSD in the browser: USD composition in WebAssembly, built on openusd (pure Rust), rendered with three.js. Reads .usd, .usda, .usdc and .usdz; loads run in a Web Worker.

npm install @huggingface/usd-web-viewer three

Usage

A ready-made viewer (renderer, lighting, orbit controls):

import { createViewer } from '@huggingface/usd-web-viewer';

const viewer = createViewer(document.getElementById('viewer')); // a container element
const { info } = await viewer.load(
  'https://huggingface.co/datasets/Robotiq-Official/simready-assets/resolve/main/Robotiq_2F_85/simready_usd/Robotiq_2F_85.usda',
);

Or into your own three.js scene:

import { loadUsd } from '@huggingface/usd-web-viewer';

const { root, complete, dispose } = await loadUsd(url);
scene.add(root); // a THREE.Group, Y-up, in meters
await complete; // textures stream in after the geometry

Physics and joints

info also reports what the stage authors for simulation (UsdPhysics) and its UsdSemantics labels, as authored: nothing is estimated. Masses are in kilograms, densities in kg/m³, inertia in kg·m², joint limits and positions in degrees or meters; positions and matrices are in stage space, like the meshes under root.

const { info, joints, setJointPositions, resetJointPositions, getJointPositions, getWorldMatrix } = await viewer.load(url);

info.physics.bodies; // rigid bodies: mass, center of mass, inertia, colliders, bodies fixed to them
info.physics.colliders; // shape, approximation (convexHull, sdf, ...), physics material
info.physics.materials; // density, friction, restitution
info.physics.joints; // revolute, prismatic, spherical, distance, fixed and generic joints with their limits and drives
info.physics.articulationRoots; // where articulations (bodies solved together, like a robot) start
info.physics.frames; // Xforms under a body, often points with no mesh, like a gripper's tip
info.labels; // e.g. { path: '/RootNode', taxonomy: 'wikidata_class', values: ['cabinet'] }
info.variantSelections; // e.g. { prim: '/Robotiq_2F_85', set: 'Physics', selection: 'Physx_parallel_grip' }
info.dependencies; // every layer and texture the stage read, with its size

joints; // the joints setJointPositions can move, e.g. to build sliders
setJointPositions({ '/Robotiq_2F_85/Robotiq_2F_85/Joints/finger_joint': 40 }); // revolute and prismatic joints, any number at once; what hangs from them and mimic joints follow
getJointPositions(); // where every revolute and prismatic joint is now
getWorldMatrix('/SO101/gripper/gripper_frame_link'); // where a body, frame or mesh under a body is now and which way it faces, as a THREE.Matrix4 in the scene; null if it is none of those
resetJointPositions(); // back to the authored pose

Posing is kinematic only (no collisions or gravity) and cheap enough for every frame of a slider drag or a recording.

Options

loadUsd(url, options) and viewer.load(url, options) take:

| Option | Default | | | ------------------------------ | ------------------- | ------------------------------------------------------------------------------- | | textures | 'preview' | 'none', 'preview' (base color, small data maps, no normal maps) or 'full' | | maxTextureSize | 1024 | Long side of decoded textures, in pixels | | signal | | An AbortSignal; the load rejects with a UsdLoadError of code aborted | | onProgress | | Called with the stage and an overall fraction from 0 to 1 | | files | | Load dropped or picked files instead of the network (see below) | | wasmUrl, workerUrl | next to the package | Where the WASM binary and the worker script are served from | | maxConcurrentFetches | 16 | Requests in flight at once | | maxLayerBytes, maxLayers | 768 MiB, 1024 | Layer download limits | | maxTextureBytes | 512 MiB | Texture download limit | | maxTriangles, maxInstances | 20M, 100,000 | What is drawn at most |

createViewer(container, options) takes background (default transparent), onContextLost and onContextRestored (called with a reload of the last model shown).

Failures are UsdLoadErrors with a code (aborted, fetch, compose, worker, webgl); anything that could not be shown faithfully is listed in info.warnings. Every option, error and warning is typed.

Loading untrusted files

  • Requests are sent like <model-viewer>'s: cookies only to the page's own origin (credentials: 'same-origin'), no custom headers, no referrer.
  • Layers and textures are fetched over http(s) only.
  • Parsing runs in Rust compiled to WebAssembly, in a Web Worker.
  • Each load is capped: maxLayerBytes (768 MiB), maxLayers (1024), maxTextureBytes (512 MiB), maxTriangles (20M) and maxInstances (100,000); images up to 16384 px a side and 8192 x 8192 px in area; prims nested up to 256 levels deep; .usdz entries up to 512 MiB each and 1 GiB in all, stored uncompressed.
  • Malformed files fail the load with a UsdLoadError.

Local files

To show files dropped on the page or picked with <input type="file" webkitdirectory>, pass them as files, keyed by their path in the package, and load the root layer's key. Relative paths in the files resolve against each other; nothing is fetched for them.

const files = new Map([...input.files].map((file) => [file.webkitRelativePath || file.name, file]));
await viewer.load('chair/simready_usd/sm_chair.usd', { files });

Bundlers

The worker and the WASM binary are found with new URL(..., import.meta.url), which Vite, webpack and other bundlers resolve and emit. With the Vite dev server, exclude the package from dependency pre-bundling:

// vite.config.js
export default { optimizeDeps: { exclude: ['@huggingface/usd-web-viewer'] } };

MIT licensed. The licenses of the Rust crates compiled into the WASM binary are in THIRD_PARTY_LICENSES.