Constructs a new NodeIO service. Instances are reusable. By default, only NodeIO can only read/write paths on disk. To enable HTTP requests, provide a Fetch API implementation and enable {@link setAllowHTTP}.
Converts a GLB-formatted Uint8Array to a JSONDocument.
Reads a Document from the given URI.
Loads a URI and returns a JSONDocument struct, without parsing.
Converts a GLB-formatted Uint8Array to a Document.
Converts glTF-formatted JSON and a resource map to a Document.
Abstract.
Registers dependencies used (e.g. by extensions) in the I/O process.
Registers extensions, enabling I/O class to read and write glTF assets requiring them.
Sets the Logger used by this I/O instance. Defaults to Logger.DEFAULT_INSTANCE.
Sets the vertex layout method used by this I/O instance. Defaults to VertexLayout.INTERLEAVED.
Writes a Document instance to a local path.
Converts a Document to a GLB-formatted Uint8Array.
Converts a Document to glTF-formatted JSON and a resource map.
Made by Don McCurdy • TypeDoc documentation • Copyright 2023, MIT license
NodeIO
I/O service for Node.js.
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).
Usage:
By default, NodeIO can only read/write paths on disk. To enable HTTP requests, provide a Fetch API implementation (such as
node-fetch
) and enable {@link setAllowHTTP}. HTTP requests may optionally be configured with RequestInit parameters.