A file save utilities that (attempts to) work consistently across browser and node.
import {writeFile} from '@loaders.gl/core';
import {DracoWriter} from '@loaders.gl/draco';
await writeFile(url, DracoWriter);
Reads the raw data from a file asynchronously.
Notes:
setPathPrefix
will be appended to relative urls.Only works on Node.js or using data URLs.
Reads the raw data from a "file" synchronously.
Notes:
setPathPrefix
will be appended to relative urls.writeFile
and writeFileAsync
functions is optional, loaders.gl loaders can be used with any data loaded via any mechanism the application prefers, e.g. fetch
, XMLHttpRequest
etc.