2 ms·
I'm a huge fan of the work here & strongly strongly believe in file-system oriented architectures. Being able to use a wide number of existing "server side" li
by rektide 10y ago
I'm a huge fan of the work here & strongly strongly believe in file-system oriented architectures.
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 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 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 https://www.npmjs.com/package/vinyl
Here's to hoping #124 - Streams Support - sees some progress. Great library John!
- mpweiher 10y ago> I'm a huge fan of the work here & strongly strongly believe in file-system oriented architectures. Me too! You might be interested in the way scheme-handlers abstract/generalize filesystems in Objective-Smalltalk. http://objective.st 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.
- jvilk 10y agoThanks, rektide! Streams support haven't been added since a) there hasn't appeared to be great demand from folks using the library, and b) I haven't needed it for any project at all. 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.
- deleted 10y ago[deleted]