emularity icon indicating copy to clipboard operation
emularity copied to clipboard

Use BrowserFS's New FS Constructor

Open jvilk opened this issue 10 years ago • 0 comments

Hey @db48x!

I just added the ability to construct additional FS modules and use them in the EmscriptenFS in v0.5.3.

Secondary FS modules function identically to the standard FS module, except that you can't do the following:

var secondaryFs = new BrowserFS.BFSRequire('fs').FS();
var writeFile = secondaryFs.writeFile;
writeFile(...) // will fail because secondaryFs is an object with state; writeFile needs to be invoked on it

To use a secondary FS module with the Emscripten FS, simply pass it in as the last argument to the EmscriptenFS constructor.

I hope this helps your modularity story! :)

Let me know if you have any issues or questions.

jvilk avatar Nov 08 '15 06:11 jvilk