BrowserFS: an in-browser filesystem with many back ends
github.com
github.com
Being able to use a wide number of existing "server side" libraries in the browser could be a huge win.
And this has interesting server side applications too, where one can use the same Node.js code but target diverse & interesting backends & overlayed systems. Having a virtual-fs is an incredibly powerful and useful concept.
"Everything is a file!" still sounds like a great idea.
Alas BrowserFS lacks Streams support. Given how async oriented and streams based a lot of new JS tends to be, that is a huge sticking point for me, and a glaring exception that will rule out using a very sizable number of existing packages that otherwise would benefit greatly from BrowserFS. Issue 124, Support streams: https://github.com/jvilk/BrowserFS/issues/124
As an alternative: it lacks the flexible, pluggible/mountable backend of BrowserFS, but level-filesystem does do streams, and can be run in the browser (when combined with level-up): https://github.com/mafintosh/level-filesystem
Final aside, I always thought it would have been cool if the virtual file abstraction that the Gulp build tool built - Vinyl - had started getting used outside Gulp. Theres no file-system model, just a file model here, except for implicitly in that files have paths, but with some mapping one can imagine making something like BrowserFS or other with the Vinyl model. That said, I think John has done a great job with his rigorous, TypeScript-ed object model in BrowserFS. https://www.npmjs.com/package/vinyl
Here's to hoping #124 - Streams Support - sees some progress. Great library John!
Me too! You might be interested in the way scheme-handlers abstract/generalize filesystems in Objective-Smalltalk. http://objective.st Super-simple + superficial example:
file:hello.txt := 'Hello World!'.
I've used the same concepts to treat a sync system effectively like rsync. You have common names (possibly translated) and tell the system to copy things over. It tells you when it's done so.Feel free to leave comments on the issue if you or others would like to use BrowserFS but have been dissuaded because it lacks streams. I'm interested in your use cases. If your files are relatively small, then basic stream support can be bolted on with 100% preloaded files. If they are larger, then it would require a larger effort to bolt on incremental file loading into each backend to support streams.
In seriousness, is the performance of Doppio bearable? Also, what are the use cases for a thing like that?
http://www.codemoo.com/ uses it to teach students basic Java in a game format.
Still this is insanely cool.
BrowserFS is yet another module to consider to add as part of this toolchain which will help us stick to the basics instead of reinventing the wheel. Unfortunately, there is no S3 backend at the moment but by having a quick look at memory backend it may be an easy thing to add.
file:///Users/user/plain.txt
From: http://example.com/plain.txt
I feel like something that blurs this boundary could be dangerous for non-developers and less techincal folks.Things like Flash and Java applets often bridged that gap, causing many problems.
I wonder how many people understand the reasons for a clear distinction between browsing files on your machine with an FS explorer, versus an isolated file store jailed or sandboxed to the browser?