-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in page:Advanced APIs #23253
Comments
I agree these docs should be improved, but note that new development is focused mostly on WasmFS now. The JS APIs may be identical in some cases, but not always. If you are writing an FS backend, perhaps it can be a WasmFS backend? Here is the MEMFS version in WasmFS: Other backends in that dir have examples of JS integration if you need that. |
@kripken i work on javascript app that uses Postgres compiled to WASM. I need to implement javascript bindings for emscripten FS that would proxy my virtual FS with encryption, that is implemented in javascript. Does cpp files related for my case? What is WasmFS? Currently i don't understand how FS does work in emscripten and how i can implement my own backend on JS. |
An overview of WasmFS is here: https://emscripten.org/docs/api_reference/Filesystem-API.html#new-file-system-wasmfs It is basically stable, but not yet feature complete (I'm updating the docs on that now). You can implement JS bindings in WasmFS, so I think it is relevant for you. Here is a simple JS File backend: https://github.com/emscripten-core/emscripten/blob/main/src/library_wasmfs_js_file.js (C++ side is minimal: https://github.com/emscripten-core/emscripten/blob/main/system/lib/wasmfs/backends/js_file_backend.cpp) That is a simple example, but see the OPFS backend (alongside those files) for a very detailed and sophisticated one. Documentation could definitely be better, but reading the simple backends like JS File should be helpful. That is what I do when I write a backend. |
Section "Advanced File System API" have no explanation for every method.
I working on implementing my own file system, and i can't understand what to do, because documentation do not have API description.
For example i've checked MEMFS implementation and i want to understand what a
FS.createNode
call do, i go to https://emscripten.org/docs/api_reference/advanced-apis.html#FS.createNode but there are no any elaboration what this method do.URL: ../../docs/api_reference/advanced-apis
Proposal
Explain what every method do and optionally add short description how to implement own file system and examples if possible
The text was updated successfully, but these errors were encountered: