-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Question: How do I access FileSystem in wasmJs? #1463
Comments
Try wasmWasi ? |
We expose the Node FileSystem in Kotlin/JS only. For WASM we have the WASI FileSystem, which is needs its directories to be specified. |
Or if you're in a browser you have to use the JS file system API directly and can't use Okio: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API. In that case you can wrap your file system interactions in a higher-level suspending interface and switch between Okio and native JS implementations. |
@JakeWharton will there be in the future a okio-fs wrapper around browser's filesystem apis (without node)? |
No. Okio's file system API only supports contexts where it can be used in a synchronous, blocking manner. |
I'm using following multiplatform configuration for wasm target
trying to add nodefilesystem dep
But getting following error
Which kind of makes sense.
Is there any option for wasmJs to read from real fs the same way it works for js targets?
The text was updated successfully, but these errors were encountered: