H-Plus-Time / object-store-wasm

Apache License 2.0
3 stars 1 forks source link

TODO: File System Access API #10

Open H-Plus-Time opened 7 months ago

H-Plus-Time commented 7 months ago

Parts of this are relatively easy to work with if you're using one of the Wasm*Store instances, for instance:

const stream = await instance.get(fooUrl);
const fsHandle = await window.showSaveFilePicker();
const writableStream = await fsHandle.createWritable();
await stream.pipeTo(writableStream);

The parts that aren't are:

It's likely easier to start with the OPFS first, then account for the required user interaction bits.