Mirrors the synchronous file system into the asynchronous file system.
IMPORTANT: You must call initialize
on the file system before it can be used.
The synchronous file system to mirror the asynchronous file system to.
The asynchronous file system to mirror.
Create the file at path p with the given mode. Then, open it with the given flag.
Called once to load up files from async storage into sync storage.
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.
Generated using TypeDoc
AsyncMirrorFS mirrors a synchronous filesystem into an asynchronous filesystem by:
The two stores will be kept in sync. The most common use-case is to pair a synchronous in-memory filesystem with an asynchronous backing store.
Example: Mirroring an IndexedDB file system to an in memory file system. Now, you can use IndexedDB synchronously.
new BrowserFS.FileSystem.IndexedDB(function (e, idbfs) { var inMemory = new BrowserFS.FileSystem.InMemory(); var mirrored = new BrowserFS.FileSystem.AsyncMirror(inMemory, idbfs); mirrored.initialize(function (e) { BrowserFS.initialized(mirrored); }); });