Class FetchFS

A simple filesystem backed by HTTP using the fetch API.

Index objects look like the following:

{
"version": 1,
"entries": {
"/home": { ... },
"/home/jvilk": { ... },
"/home/james": { ... }
}
}

Each entry contains the stats associated with the file.

Hierarchy (view full)

Constructors

Properties

_disableSync?: boolean

Whether the sync cache should be disabled. Only affects async things.

_isInitialized: boolean = false
baseUrl: string
index: Index = ...
requestInit?: RequestInit

Methods

  • Test whether or not path exists.

    Parameters

    • path: string

    Returns Promise<boolean>

  • Preload the path into the index.

    Parameters

    • path: string
    • buffer: Uint8Array

    Returns void