I/O service for Web.

The most common use of the I/O service is to read/write a Document with a given path. Methods are also available for converting in-memory representations of raw glTF files, both binary (ArrayBuffer) and JSON (JSONDocument).


import { WebIO } from '@gltf-transform/core';

const io = new WebIO({credentials: 'include'});

// Read.
const doc = await io.read('model.glb');  // → Document
const doc = io.readBinary(ArrayBuffer);  // → Document

// Write.
const arrayBuffer = io.writeBinary(doc); // → ArrayBuffer



  • new WebIO(_fetchConfig?: RequestInit): WebIO


  • readBinary(glb: ArrayBuffer): Document
  • registerDependencies(dependencies: {}): WebIO
  • writeBinary(doc: Document): ArrayBuffer
  • writeJSON(doc: Document, _options?: Partial<Pick<WriterOptions, "format" | "basename">>): JSONDocument
Function symbol, f(📦) → 📦, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy TypeDoc documentation Copyright 2021 under MIT license