0.2.0 • Published 1 month ago

@irori/idbfs v0.2.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
1 month ago

idbfs

This library provides access to the Emscripten file system, including IDBFS. It can be used to manipulate the contents of IDBFS stored by other Emscripten apps.

Usage

This is nothing more than an empty Emscripten program compiled with IDBFS enabled, so you can use the Emscripten file system API on it.

Example

The following example reads data.txt in an IDBFS mounted on /idbfs.

const idbfsModule = await import('https://unpkg.com/@irori/idbfs/idbfs.js');
const idbfs = await idbfsModule.default();

idbfs.FS.mkdir('/idbfs');
idbfs.FS.mount(idbfs.IDBFS, {}, '/idbfs');
idbfs.FS.syncfs(true, (err) => {
    if (err) throw err;
    console.log(idbfs.FS.readFile('/idbfs/data.txt', { encoding: 'utf8' }));
});
0.2.0

1 month ago

0.1.0

8 months ago

0.0.0

8 months ago