Setu-TS
    Preparing search index...

    Interface NodeHost

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

    interface NodeHost {
        createReadStream?: (
            path: string,
            options?: { end?: number; start?: number },
        ) => ReadableStream | null;
        env: Record<string, string | undefined>;
        exit: (code?: number) => never;
        hostname: string;
        mkdir: (path: string, options?: { recursive?: boolean }) => Promise<void>;
        nodeVersion: string;
        onSignal: (signal: RuntimeSignal, handler: () => void) => void;
        readdir: (path: string) => Promise<readonly string[]>;
        readFile: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
        realPath: (path: string) => Promise<string>;
        rm: (path: string, options?: { recursive?: boolean }) => Promise<void>;
        stat: (path: string) => Promise<NodeFsInfo>;
        writeFile: (path: string, data: Uint8Array) => Promise<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: Record<string, string | undefined>

    Environment variable map.

    exit: (code?: number) => never

    Exit the process.

    hostname: string

    Host name string.

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

    Create a directory.

    nodeVersion: string

    Node.js version string (e.g. "v18.19.0").

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

    Registers a process-termination signal listener.

    readdir: (path: string) => Promise<readonly string[]>

    List directory entries.

    readFile: (path: string) => Promise<Uint8Array<ArrayBufferLike>>

    Read file as bytes.

    realPath: (path: string) => Promise<string>

    Resolve a path to its canonical absolute form, following symlinks.

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

    Remove a file or directory.

    stat: (path: string) => Promise<NodeFsInfo>

    Get file/directory info.

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

    Write bytes to a file.