Deprecated. Please use XmlHttpRequest.Create() method instead to construct XmlHttpRequest objects.
Constructs the file system. You must provide the directory listing as a JSON object
produced by the make_xhrfs_index
script.
DEPRECATED: You may pass a URL to the file index to the constructor, which will fetch the file index synchronously and may freeze up the web page. This behavior will be removed in the next major version of BrowserFS.
index object or the path to the JSON file index generated by
make_xhrfs_index
.
URL that is prepended to any file locations in the file index. e.g. if prefixUrl = 'data/
, and the user wants to open the file /foo.txt
,
the file system will fetch file data/foo.txt
. The browser will access the file relative to the currrent webpage
URL.
Create the file at path p with the given mode. Then, open it with the given flag.
Opens the file at path p with the given flag. The file must exist.
The path to open.
The flag to use when opening the file.
Special XHR function: Preload the given file into the index.
We have the entire file as a buffer; optimize readFile.
Specially-optimized readfile.
Construct an XmlHttpRequest file system backend with the given options.
Deprecated. Please use XmlHttpRequest.Create() method instead to construct XmlHttpRequest objects.
Constructs an XmlHttpRequest object using the directory listing at the given URL. Uses the base URL as the URL prefix for fetched files.
Called when the file system has been instantiated, or if an error occurs.
Generated using TypeDoc
A simple filesystem backed by XMLHttpRequests. You must create a directory listing using the
make_xhrfs_index
tool provided by BrowserFS.If you install BrowserFS globally with
npm i -g browserfs
, you can generate a listing by runningmake_xhrfs_index
in your terminal in the directory you would like to index:make_xhrfs_index > index.json
Listings objects look like the following:
This example has the folder
/home/jvilk
with subfilesomeFile.txt
and subfoldersomeDir
.