Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BrowserFS's New FS Constructor #4

Open
jvilk opened this issue Nov 8, 2015 · 0 comments
Open

Use BrowserFS's New FS Constructor #4

jvilk opened this issue Nov 8, 2015 · 0 comments

Comments

@jvilk
Copy link
Contributor

jvilk commented Nov 8, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant