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

@preference-sl/pref-gltf-transform

v1.0.5

Published

Web component to complete GLTF

Readme

@preference-sl/pref-gltf-transform

Helper utilities built on top of glTF Transform to process glTF assets in the browser.

Features:

  • Complete GLTF: Pack a .gltf and its external buffers into a single .gltf file.
  • Caching: Uses IndexedDB to cache large binary assets to avoid re-downloading.

Installation

npm install @preference-sl/pref-gltf-transform

Usage

1. Import in Modern Bundlers (Vite, Webpack, etc.)

import {
  completeModelGLTF
} from '@preference-sl/pref-gltf-transform';

// ... usage

2. Import in Browser (without bundler)

Browsers require an Import Map to resolve the package name if you are not using a build tool.

index.html:

<script type="importmap">
{
  "imports": {
    "@preference-sl/pref-gltf-transform": "./node_modules/@preference-sl/pref-gltf-transform/www/pref-gltf-transform.js"
  }
}
</script>
<script type="module">
  import { LoadModelGLTF } from '@preference-sl/pref-gltf-transform';
</script>

API

completeModelGLTF(gltfUrl: string, kbUrl: string): Promise<string>

Parameters

gltfUrl: string

URL to the original (incomplete) .gltf file.

  • The file may reference external .bin buffers
  • The JSON may be loaded from cache or fetched from the network

kbUrl: string

Host (or host:port) of the KB server where external buffers (parts) are stored.

  • HTTPS protocol is automatically used
  • Examples:
    • example.com
    • example.com:8443

Returns

Promise<string>

A Blob URL (blob:...) pointing to the completed GLTF file with all referenced buffers embedded as Base64 data URIs.


Convert GLTF to GLB

  1. Install gltf-transform
npm install --global @gltf-transform/cli
  1. Convert GLTF to GLB
gltf-transform copy input.gltf output.glb

Development

If you want to contribute or modify this package:

Build

Compiles TypeScript to JavaScript (www/pref-gltf-transform.js) and generates types (www/pref-gltf-transform.d.ts).

npm run build

Test

Runs the verification script in the playground/ directory.

npm test

Playground

A local test environment is available in playground/.

  1. Build the project: npm run build
  2. Pack it: npm pack
  3. Go to playground: cd playground
  4. Install tarball: npm install ../preference-sl-pref-gltf-transform-1.0.0.tgz
  5. Run server: npx serve .

Publishing

  1. Increment version in package.json.
  2. Run the release script:
    npm run release

The script will automatically:

  • Run npm run build
  • Publish to npm with public access
  • Handle errors gracefully