-
Notifications
You must be signed in to change notification settings - Fork 226
Description
I need some emscripten FS that would make able to dump content and load content fast, but all operations must happens in RAM, because all data are secret data encrypted on high level.
Ideally it must be a virtual FS that places whole data in single buffer, like tar archive or something.
Is it possible with BrowserFS? Maybe this project have solution for that, or you may navigate me to another solution, or explain how to implement this code myself with BrowserFS?
Ideally the API would looks kinda
// Initializing
const fs = new CustomFS();
// First time we set an empty buffer or maybe create formatted buffer with some util
const content = new Uint8Array().buffer;
fs.setBuffer(content);
// Now custom FS acts with files from our buffer. Read, write, etc.
// We may dump buffer immediately, to snapshot our FS,
// and then load buffer next run, to continue from snapshot state
dumpData(content);I work on note-taking app that uses PGlite that uses emscripten FS. Users may encrypt their workspace, this is core feature, so i can't just mount NodeFS, since secret data would be placed naked on user disk and may be recovered later. I have issue in PGlite repo with more details if you need a context.