Represents FsClient implementation which uses File System Access API under the hood for persistent storage. Meant to be used in a browser environment.

Limitations

  • Symlinks are not supported
  • Partial support for statistics returned by stat or lstat methods: size and mtimeMs are only supported and only for files
  • Poor browser support:
    • Chromium - full support
    • WebKit - partial support, could be supported in the Worker thread after some modifications here
    • Firefox - is not supported

See

Example

const root = await navigator.storage.getDirectory()
const reposRoot = await root.getDirectoryHandle('repos', { create: true })
const fs = new FileSystemAccessApiFsClient(reposRoot)

Hierarchy

  • FileSystemAccessApiFsClient

Implements

Constructors

Methods

  • Return true if a entry exists, false if it doesn't exist. Rethrows errors that aren't related to entry existance.

    Parameters

    • path: string

    Returns Promise<boolean>

  • Reads a slice of a file from the given byte range [start, end). This enables reading portions of large files without loading them entirely into memory.

    This method is optional. If not implemented, callers should fall back to reading the entire file with readFile.

    Parameters

    • path: string
    • start: number
    • end: number

    Returns Promise<Uint8Array>

Generated using TypeDoc