Emscripten has an experimental WASM-based FS implementation in addition to the current JS-based FS implementation.
The main difference that I am aware of is that JS-FS only allows synchronous processing, while WASM-FS allows asynchronous processing.
If you can do asynchronous processing, you can use ZenFS's asynchronous API and avoid all the problems associated with synchronizing asynchronous APIs.
I have implemented WASMFS Backend which uses ZenFS asynchronous API in my project.
atty303/pob-web:packages/driver/src/c/wasmfs/nodefs_js.cpp
It is closely tied to the user project and is not cut out to be generic. However, we thought it would be beneficial to have a generic ZenFS (or Node asynchronous API) backend. I think its implementation would need to be coordinated with the Emscripten project.
Not sure if this is ZenFS work, but I'll leave it as an idea.
Emscripten has an experimental WASM-based FS implementation in addition to the current JS-based FS implementation.
The main difference that I am aware of is that JS-FS only allows synchronous processing, while WASM-FS allows asynchronous processing.
If you can do asynchronous processing, you can use ZenFS's asynchronous API and avoid all the problems associated with synchronizing asynchronous APIs.
I have implemented WASMFS Backend which uses ZenFS asynchronous API in my project.
atty303/pob-web:packages/driver/src/c/wasmfs/nodefs_js.cpp
It is closely tied to the user project and is not cut out to be generic. However, we thought it would be beneficial to have a generic ZenFS (or Node asynchronous API) backend. I think its implementation would need to be coordinated with the Emscripten project.
Not sure if this is ZenFS work, but I'll leave it as an idea.