Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOM backends for browser-fs-core

License

NotificationsYou must be signed in to change notification settings

saoirse-iontach/browser-fs-dom

 
 

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.

Projectauthortimelinelinks
BrowserFSJohn Vilk2014 - 2017npmgithub
@BrowserFSdr-Vortex09/2023 - 03/2024npmgithub
@ZenFSdr-Vortex03/2024 - ...npmgithub

dr-Vortext is an alias ofJames P

Versions

versions details

@BrowserFS/fs-dom and@ZenFS/dom share the same repository:

  • Versions<=v0.0.6 are@BrowserFS/fs-dom
  • Versions>=v0.1.3 are@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 versionDescription
v0.0.6Original@BrowserFS version
v0.0.7-iontachInitalIontach bugfix
~v0.1.10NewerIontach bugfix
semver:0.1SimplifiedIontach release scheme

Packagessaoirse-iontach/browser-fs-dom#semver:0.1
depends onsaoirse-iontach/browser-fs-core#semver:0.1
which emulatenode:fsv14.x.x.

Citing

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}}

License

BrowserFS andZenFS are licensed under the MIT License. SeeLICENSE for details.

Backends

  • HTTPRequest: Downloads files on-demand from a webserver usingfetch.
  • Storage: Stores files in aStorage object, likelocalStorage andseesionStorage.
  • IndexedDB: Stores files into anIndexedDB object 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.

Installing

npm install saoirse-iontach/browser-fs-dom# @browserfs/fs-dom

Building

  • Make sure you have Node and NPM installed. You must have Node v18 or newer.
  • Install dependencies withnpm install
  • Build usingnpm run build
  • You can find the built code indist.

Testing

Run unit tests withnpm test.

Usage

🛈 The examples are written in ESM. If you are using CJS, you canrequire the package. If running in a browser you can add a script tag to your HTML pointing to thebrowser.min.js and use BrowserFS DOM via the globalBrowserFS_DOM object.

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

Stars

Watchers

Forks

Languages

  • TypeScript96.8%
  • JavaScript3.2%

[8]ページ先頭

©2009-2025 Movatter.jp