Class PortFS

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

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

Hierarchy

  • {
        _sync?: FileSystem;
        createFileSync(path, flag, mode): File;
        linkSync(srcpath, dstpath): void;
        mkdirSync(path, mode): void;
        openFileSync(path, flag): File;
        queueDone(): Promise<void>;
        readdirSync(path): string[];
        ready(): Promise<void>;
        renameSync(oldPath, newPath): void;
        rmdirSync(path): void;
        statSync(path): Stats;
        syncSync(path, data, stats): void;
        unlinkSync(path): void;
    } & FileSystem<this>
    • PortFS

Constructors

  • Constructs a new PortFS instance that connects with ZenFS running on the specified 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

  • Parameters

    • path: string
    • flag: string
    • mode: number

    Returns Promise<File>

  • Parameters

    • path: string
    • flag: string
    • mode: number

    Returns File

  • Parameters

    • path: string

    Returns Promise<boolean>

  • Test whether or not the given 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

  • Parameters

    • path: string
    • flag: string

    Returns File

  • 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" | "ready" | "rename" | "stat" | "openFile" | "rmdir" | "unlink" | "mkdir" | "readdir" | "sync" | "metadata" | "createFile" | "exists"

    Parameters

    Returns Promise<Awaited<ReturnType<ExtractProperties<FileSystem, ((...args) => 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