Setu-TS
    Preparing search index...

    Interface BunHost

    Minimal interface covering the Bun-specific operations used by this adapter. Inject this interface to test the adapter without real Bun.

    interface BunHost {
        createReadStream?: (
            path: string,
            options?: { end?: number; start?: number },
        ) => ReadableStream | null;
        env: { [key: string]: string | undefined };
        exit: (code?: number) => never;
        hostname: string;
        mkdir: (path: string, options?: { recursive?: boolean }) => boolean;
        onSignal: (signal: RuntimeSignal, handler: () => void) => void;
        readdir: (path: string) => readonly string[] | null;
        readFile: (path: string) => Uint8Array<ArrayBufferLike> | null;
        realPath: (path: string) => string | null;
        rm: (path: string, options?: { recursive?: boolean }) => boolean;
        stat: (path: string) => BunFileInfo | null;
        version: string;
        writeFile: (path: string, data: Uint8Array) => void;
    }
    Index
    createReadStream?: (
        path: string,
        options?: { end?: number; start?: number },
    ) => ReadableStream | null

    Create a read stream for a file. Returns null if the file cannot be opened.

    env: { [key: string]: string | undefined }

    Environment variable map.

    exit: (code?: number) => never

    Exit the process.

    hostname: string

    Returns the host name.

    mkdir: (path: string, options?: { recursive?: boolean }) => boolean

    Create a directory.

    onSignal: (signal: RuntimeSignal, handler: () => void) => void

    Registers a process-termination signal listener.

    Sourced from node:process, not the Bun global — see this module's own header for why the global cannot be trusted to carry these members.

    readdir: (path: string) => readonly string[] | null

    List directory entries.

    readFile: (path: string) => Uint8Array<ArrayBufferLike> | null

    Read file as bytes.

    realPath: (path: string) => string | null

    Resolve a path to its canonical absolute form (null when it cannot be resolved).

    rm: (path: string, options?: { recursive?: boolean }) => boolean

    Remove a file or directory.

    stat: (path: string) => BunFileInfo | null

    Get file/directory info.

    version: string

    Bun version string.

    writeFile: (path: string, data: Uint8Array) => void

    Write bytes to a file.