aboutsummaryrefslogtreecommitdiff
path: root/06_storage/init_idbfs.js
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-06-06 09:13:54 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-06-06 09:13:54 +0200
commitab0db69a7b11ba1a9dc52d50c94e9e321b70ebf0 (patch)
tree76be6a8b1596ea1e74dbf7085b85214c2c83e69a /06_storage/init_idbfs.js
parent961c3470d7e9bdf5efbe0509f586be75d7052d8b (diff)
downloademscripten-tutorial-ab0db69a7b11ba1a9dc52d50c94e9e321b70ebf0.tar.gz
emscripten-tutorial-ab0db69a7b11ba1a9dc52d50c94e9e321b70ebf0.zip
Added example 6
Diffstat (limited to '06_storage/init_idbfs.js')
-rw-r--r--06_storage/init_idbfs.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/06_storage/init_idbfs.js b/06_storage/init_idbfs.js
new file mode 100644
index 0000000..82483f4
--- /dev/null
+++ b/06_storage/init_idbfs.js
@@ -0,0 +1,16 @@
1Module['preRun'] = [
2 async () => {
3 const dir = "/assets";
4
5 FS.mkdir(dir);
6 FS.mount(IDBFS, { autoPersist: true }, dir);
7
8 Module.fileSystemLoaded = new Promise((resolve, reject) => {
9 FS.syncfs(true, (err) => {
10 if (err) reject(err);
11 else resolve(true);
12 });
13 });
14
15 }
16];

Generated with cgit - Back to sebastiano.tronto.net