- Notifications
You must be signed in to change notification settings - Fork0
DOM backends for browser-fs-core
License
saoirse-iontach/browser-fs-dom
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
@BrowserFS backends for DOM APIs.
DOM APIs areonly available natively in browsers.
BrowserFS is an in-browser file system that emulates theNode JS file system API and supports storing and retrieving files from various backends. BrowserFS also integrates nicely with other tools.
Note
@ZenFS is an (breaking) update ofBrowserFS,with anode:fs interface.As of April 2024, it is still in development, that's to say instable and not properly working (expectially encodings, with bad tests). More over contributors are actually dismissed. Andcitation of original academic papers was sadly discarded...
@BrowserFS istransient projectfromBrowserFS towards@ZenFS, (illegitimacy?) claiming to be the nextBrowserFS (in fact it is@ZenFS before rebranding)[!IMPORTANT]@BrowserFS-iontach is a bugfixed fork of@BrowserFS @1.0.
| Project | author | timeline | links |
|---|---|---|---|
| BrowserFS | John Vilk | 2014 - 2017 | npmgithub |
| @BrowserFS | dr-Vortex | 09/2023 - 03/2024 | npmgithub |
| @ZenFS | dr-Vortex | 03/2024 - ... | npmgithub |
dr-Vortext is an alias ofJames P
versions details
@BrowserFS/fs-dom and@ZenFS/dom share the same repository:
- Versions
<=v0.0.6are@BrowserFS/fs-dom - Versions
>=v0.1.3are@ZenFS/dom
Versionsv0.0.6 - v0.2.14 are equivalent;
Some fixes, but mainly cosmetics.
But Worker and HTTPRequest backends were removed in v0.1.0.
Versions of thisIontach fork:
| Iontach version | Description |
|---|---|
v0.0.6 | Original@BrowserFS version |
v0.0.7-iontach | InitalIontach bugfix |
~v0.1.10 | NewerIontach bugfix |
semver:0.1 | SimplifiedIontach release scheme |
Packagessaoirse-iontach/browser-fs-dom#semver:0.1
depends onsaoirse-iontach/browser-fs-core#semver:0.1
which emulatenode:fsv14.x.x.
BrowserFS is a component of theDoppio andBrowsix research projects from the PLASMA lab at the University of Massachusetts Amherst. If you decide to use BrowserFS in a project that leads to a publication, please cite the academic papers onDoppio andBrowsix.
citations
John Vilk and Emery D. Berger. Doppio: Breaking the Browser Language Barrier. InProceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation(2014), pp. 508–518.
references
@inproceedings{VilkDoppio,author={John Vilk and Emery D. Berger},title={{Doppio: Breaking the Browser Language Barrier}},booktitle={Proceedings of the 35th {ACM} {SIGPLAN} Conference on Programming Language Design and Implementation},pages={508--518},year={2014},url={http://doi.acm.org/10.1145/2594291.2594293},doi={10.1145/2594291.2594293}}
Bobby Powers, John Vilk, and Emery D. Berger. Browsix: Bridging the Gap Between Unix and the Browser.InProceedings of the Twenty-Second International Conference on Architectural Supportfor Programming Languages and Operating Systems (2017), pp. 253–266.
references
@inproceedings{PowersBrowsix,author={Bobby Powers and John Vilk and Emery D. Berger},title={{Browsix: Bridging the Gap Between Unix and the Browser}},booktitle={Proceedings of the Twenty-Second International Conference on Architectural Support for Programming Languages and Operating Systems},pages={253--266},year={2017},url={http://doi.acm.org/10.1145/3037697.3037727},doi={10.1145/3037697.3037727}}
BrowserFS andZenFS are licensed under the MIT License. SeeLICENSE for details.
HTTPRequest: Downloads files on-demand from a webserver usingfetch.Storage: Stores files in aStorageobject, likelocalStorageandseesionStorage.IndexedDB: Stores files into anIndexedDBobject database.WorkerFS: Lets you mount the BrowserFS file system configured in the main thread in a WebWorker, or the other way around!
For more information, see theAPI documentation.
npm install saoirse-iontach/browser-fs-dom# @browserfs/fs-dom- Make sure you have Node and NPM installed. You must have Node v18 or newer.
- Install dependencies with
npm install - Build using
npm run build - You can find the built code in
dist.
Run unit tests withnpm test.
🛈 The examples are written in ESM. If you are using CJS, you can
requirethe package. If running in a browser you can add a script tag to your HTML pointing to thebrowser.min.jsand use BrowserFS DOM via the globalBrowserFS_DOMobject.
You can use DOM backends, though you must register them if you plan on usingconfigure:
import{configure,fs,registerBackend}from'@browserfs/core';import{Storage}from'@browserfs/fs-dom';registerBackend(Storage);awaitconfigure({fs:'Storage',options:{storage:localStorage}});if(!fs.existsSync('/test.txt')){fs.writeFileSync('/test.txt','This will persist across reloads!');}constcontents=fs.readFileSync('/test.txt','utf-8');console.log(contents);
About
DOM backends for browser-fs-core
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Languages
- TypeScript96.8%
- JavaScript3.2%