I/O service for Deno.

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 (Uint8Array) and JSON (JSONDocument).

NOTICE: Support for the Deno environment is currently experimental. See glTF-Transform#457.

Usage:

import { DenoIO } from 'https://esm.sh/@gltf-transform/core';
import * as path from 'https://deno.land/std/path/mod.ts';

const io = new DenoIO(path);

// Read.
let document;
document = io.read('model.glb');  // → Document
document = io.readBinary(glb);    // Uint8Array → Document

// Write.
const glb = io.writeBinary(document);  // Document → Uint8Array

Hierarchy

Constructors

  • new DenoIO(path: unknown): DenoIO

Methods

  • readBinary(glb: Uint8Array): Promise<Document>
  • readURI(uri: string, type: "view"): Promise<Uint8Array>
  • readURI(uri: string, type: "text"): Promise<string>
  • registerDependencies(dependencies: {}): DenoIO
  • setLogger(logger: ILogger): DenoIO
  • writeBinary(doc: Document): Promise<Uint8Array>
  • writeJSON(doc: Document, _options?: Partial<Pick<WriterOptions, "format" | "basename">>): Promise<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