Setu-TS
    Preparing search index...

    Interface BunModules

    The built-ins buildBunHost needs, injectable so every wrapper is unit-testable without real file-system access. Shapes match node:fs (sync), node:os, and node:process, all of which Bun implements.

    interface BunModules {
        bunGlobal: { version?: string } | undefined;
        fs: {
            createReadStream?: (
                path: string,
                options?: { end?: number; start?: number },
            ) => ReadableStream | null;
            mkdirSync(
                path: string,
                options?: { recursive?: boolean },
            ): string | undefined;
            readdirSync(path: string): string[];
            readFileSync(path: string): Uint8Array;
            realpathSync(path: string): string;
            rmSync(path: string, options?: { recursive?: boolean }): void;
            statSync(
                path: string,
            ): {
                mtime: Date;
                size: number;
                isDirectory(): boolean;
                isFile(): boolean;
            };
            writeFileSync(path: string, data: Uint8Array): void;
        };
        hostname: () => string;
        proc: {
            env: Record<string, string | undefined>;
            exit: (code?: number) => never;
            on: (event: RuntimeSignal, listener: () => void) => void;
            version: string;
            versions: Record<string, string | undefined>;
        };
    }
    Index
    bunGlobal: { version?: string } | undefined

    The Bun global when running on Bun, undefined elsewhere — read only for its version string. Required (rather than optional) so callers and tests state it explicitly and every version-resolution arm stays reachable.

    fs: {
        createReadStream?: (
            path: string,
            options?: { end?: number; start?: number },
        ) => ReadableStream | null;
        mkdirSync(
            path: string,
            options?: { recursive?: boolean },
        ): string | undefined;
        readdirSync(path: string): string[];
        readFileSync(path: string): Uint8Array;
        realpathSync(path: string): string;
        rmSync(path: string, options?: { recursive?: boolean }): void;
        statSync(
            path: string,
        ): { mtime: Date; size: number; isDirectory(): boolean; isFile(): boolean };
        writeFileSync(path: string, data: Uint8Array): void;
    }

    Synchronous file-system operations (compatible with node:fs).

    hostname: () => string

    Hostname function (from node:os).

    proc: {
        env: Record<string, string | undefined>;
        exit: (code?: number) => never;
        on: (event: RuntimeSignal, listener: () => void) => void;
        version: string;
        versions: Record<string, string | undefined>;
    }

    Process object (version, env, exit, signal listening).