Skip to main content

Using Writers

Writers allow applications to encoded data for a number of the formats supported by

For a detailed specification of the writer object format see the API reference.


As an example, to Draco-compress a mesh using the DracoWriter:

import {DracoWriter} from '';
import {encode} from '';

const mesh = {
attributes: {

const data = await encode(mesh, DracoWriter, options);

Input Data

Writers accept the same format of data that is produced by the corresponding loaders. This format is documented either in each loader or usually as part of the documentation for that loader category.

If applications have data in a different format, they will need to first transform the data to the format expected by the writer.