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

@joroya/loader-gltf

v1.0.2

Published

glTF/GLB 3D model loader for Oroya Animate scene graphs

Readme

@joroya/loader-gltf

glTF/GLB 3D model loader for Oroya Animate scene graphs

NPM Version License

Part of Oroya Animate - an engine-agnostic 2D/3D graphics library.

Features

  • glTF/GLB support - Load industry-standard 3D models
  • Scene graph conversion - Automatically converts to Oroya nodes
  • Material import - Preserves color, PBR material fields, opacity, and double-sided hints where available
  • Mesh support - Handles static meshes, skinned meshes, geometry buffers, and skeleton metadata
  • Blender compatible - Export from Blender and import seamlessly
  • Async loading - Non-blocking model loading

Installation

npm install @joroya/core @joroya/loader-gltf three

Quick Example

import { loadGLTF } from '@joroya/loader-gltf';

// Load a glTF model
const { scene, animations } = await loadGLTF('/models/spaceship.glb');

console.log(scene.root.children.length, animations.length);

API

loadGLTF

loadGLTF(url: string): Promise<{ scene: Scene; animations: AnimationClip[] }>

Loads a glTF or GLB file and returns an Oroya Scene plus translated animation clips.

Supported Features

  • Meshes and buffer geometry
  • Materials (color, PBR fields, opacity, double-sided)
  • Node hierarchy
  • Transformations
  • Animation clips for position, rotation, and scale tracks
  • Skinned meshes via Skin + skin indices/weights
  • 🚧 Morph targets (planned)

Usage Example

import { Scene, Node, Camera, CameraType } from '@joroya/core';
import { loadGLTF } from '@joroya/loader-gltf';
import { ThreeRenderer } from '@joroya/renderer-three';

async function main() {
  const scene = new Scene();
  
  // Setup camera
  const camera = new Node('camera');
  camera.addComponent(new Camera({
    type: CameraType.Perspective,
    fov: 75,
    aspect: window.innerWidth / window.innerHeight,
    near: 0.1,
    far: 1000
  }));
  camera.transform.position.z = 10;
  scene.add(camera);
  
  // Load model and attach its root children under this scene
  const result = await loadGLTF('/models/robot.glb');
  for (const child of [...result.scene.root.children]) {
    scene.add(child);
  }
  
  // Render
  const renderer = new ThreeRenderer({
    canvas: document.getElementById('canvas'),
    width: window.innerWidth,
    height: window.innerHeight
  });
  
  renderer.mount(scene);

  function animate() {
    renderer.render();
    requestAnimationFrame(animate);
  }
  animate();
}

main();

Error Handling

try {
  const result = await loadGLTF('/models/scene.glb');
  for (const child of [...result.scene.root.children]) {
    scene.add(child);
  }
} catch (error) {
  console.error('Failed to load model:', error);
}

Performance Tips

  • Use .glb (binary) instead of .gltf (JSON) for faster loading
  • Optimize models in Blender before export
  • Use Draco compression for smaller file sizes
  • Load models asynchronously to avoid blocking

Documentation

CDN Usage

<script type="module">
  import { Scene } from 'https://unpkg.com/@joroya/[email protected]/dist/index.js';
  import { loadGLTF } from 'https://unpkg.com/@joroya/[email protected]/dist/index.js';
  
  const scene = new Scene();
  const result = await loadGLTF('/model.glb');
  for (const child of [...result.scene.root.children]) {
    scene.add(child);
  }
</script>

Contributing

See the Contributing Guide.

License

MIT © joshuacba08