Class PortFS

PortFS lets you access an FS instance that is running in a port, or the other way around.

Note that direct synchronous operations are not permitted on the PortFS, regardless of the configuration option of the remote FS.

Hierarchy

Constructors

  • Constructs a new PortFS instance that connects with the FS running on options.port.

    Parameters

    • options: Options

    Returns PortFS

Properties

_disableSync?: boolean

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

options: Options
port: Port

Methods

  • Test whether or not path exists.

    Parameters

    • path: string

    Returns Promise<boolean>

  • Test whether or not path exists.

    Parameters

    • path: string

    Returns boolean

  • Parameters

    • srcpath: string
    • dstpath: string

    Returns Promise<void>

  • Parameters

    • srcpath: string
    • dstpath: string

    Returns void

  • Parameters

    • path: string
    • mode: number

    Returns Promise<void>

  • Parameters

    • path: string
    • mode: number

    Returns void

  • Opens the file at path with flag. The file must exist.

    Parameters

    • path: string

      The path to open.

    • flag: string

      The flag to use when opening the file.

    Returns Promise<File<FileSystem>>

  • Returns Promise<void>

  • Parameters

    • path: string

    Returns Promise<string[]>

  • Parameters

    • path: string

    Returns string[]

  • Parameters

    • oldPath: string
    • newPath: string

    Returns Promise<void>

  • Parameters

    • oldPath: string
    • newPath: string

    Returns void

  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string

    Returns void

  • Type Parameters

    • const T extends
          | "link"
          | "rename"
          | "stat"
          | "createFile"
          | "openFile"
          | "unlink"
          | "rmdir"
          | "mkdir"
          | "readdir"
          | "sync"
          | "ready"
          | "metadata"
          | "exists"

    Parameters

    Returns Promise<Awaited<ReturnType<ExtractProperties<FileSystem, ((...args: any[]) => Promise<any> | FileSystemMetadata)>[T]>>>

  • Parameters

    • path: string
    • data: Uint8Array
    • stats: Readonly<Stats>

    Returns Promise<void>

  • Parameters

    • path: string
    • data: Uint8Array
    • stats: Readonly<Stats>

    Returns void

  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string

    Returns void