@zenfs/emscripten
v1.0.7
Published
Emscripten backend for ZenFS
Downloads
137
Readme
ZenFS Emscripten Backend
ZenFS backend for usage with Emscripten.
For more information, see the docs.
Please read the ZenFS core documentation!
Installing
[!IMPORTANT] This project is licensed under the LGPL (v3+).
npm install @zenfs/emscriptenUsage
import { configure, fs } from '@zenfs/core';
import { Emscripten } from '@zenfs/emscripten';
// Note: this assumes you have included Emscripten correctly and have the global `FS` variable available.
await configureSingle({ backend: Emscripten, FS: FS });
if (!fs.existsSync('/test.txt')) {
fs.writeFileSync('/test.txt', 'This is in the Emscripten file system!');
}
const contents = fs.readFileSync('/test.txt', 'utf-8');
console.log(contents);