JSPM

@matthewcpp/binary-gltf

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q29923F
  • License MIT

"Simple tool to parse chunks from a binary gltf file"

Package Exports

  • @matthewcpp/binary-gltf

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@matthewcpp/binary-gltf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

binary-gltf

Simpe library for working with binary glTF files.

The library exposes a single parse method that takes an ArrayBuffer of a GLB file and returns an object with the following structure:

{
    json: Object,
    binary: DataView,
    extras: [
        {
            type: number,
            view: DataView
        }
    ]
}

If any error is encountered during parsing, an exception will be thrown.

Usage

To use with rollup:

import {BinaryGltf} from "@matthewcpp/binary-gltf";

try {
    const binaryGltf = BinaryGltf.parse(arrayBuffer);
} catch (e) {
    console.log(e.toString());
}

Testing

  1. Build the library by running npm run build
  2. Start the development server: npx http-server
  3. Navigate to http://localhost:8080/test/
  4. Enter GLB file url and click Load.