Update docs/usage/file-system.md about IDBFS (#4650)

This commit is contained in:
Yuichiro Tachibana (Tsuchiya) 2024-03-30 12:38:50 +09:00 committed by GitHub
parent bd643ae5f7
commit c776168c53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -45,10 +45,10 @@ For instance, to store data persistently between page reloads, one could mount
a folder with the
[IDBFS file system](https://emscripten.org/docs/api_reference/Filesystem-API.html#filesystem-api-idbfs)
```js
```pyodide
let mountDir = "/mnt";
pyodide.FS.mkdirTree(mountDir);
pyodide.FS.mount(pyodide.FS.filesystems.IDBFS, { root: "." }, mountDir);
pyodide.FS.mount(pyodide.FS.filesystems.IDBFS, {}, mountDir);
```
If you are using Node.js you can access the native file system by mounting `NODEFS`.