mlx-bun library API
    Preparing search index...
    interface BenchOptions {
        bun?: string;
        graceMs?: number;
        now?: () => number;
        script?: string;
        spawn?: {
            <
                const In extends Writable = "ignore",
                const Out extends Readable = "pipe",
                const Err extends Readable = "inherit",
            >(
                options: SpawnOptions<In, Out, Err> & { cmd: string[] },
            ): Subprocess<In, Out, Err>;
            <
                const In extends Writable = "ignore",
                const Out extends Readable = "pipe",
                const Err extends Readable = "inherit",
            >(
                cmds: string[],
                options?: SpawnOptions<In, Out, Err>,
            ): Subprocess<In, Out, Err>;
        };
        storage: Pick<StorageService, "path">;
    }
    Index
    bun?: string

    The Bun executable that runs it; default the one on PATH.

    graceMs?: number

    SIGTERM first (bench-serve stops its servers and saves the run), then SIGKILL after this. Default 70 s.

    now?: () => number
    script?: string

    bench-serve.ts; default the checkout's.

    storage: Pick<StorageService, "path">
    spawn?: {
        <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            options: SpawnOptions<In, Out, Err> & { cmd: string[] },
        ): Subprocess<In, Out, Err>;
        <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            cmds: string[],
            options?: SpawnOptions<In, Out, Err>,
        ): Subprocess<In, Out, Err>;
    }

    Test seam for process creation.

    Type Declaration

      • <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            options: SpawnOptions<In, Out, Err> & { cmd: string[] },
        ): Subprocess<In, Out, Err>
      • Spawn a new process

        Type Parameters

        • const In extends Writable = "ignore"
        • const Out extends Readable = "pipe"
        • const Err extends Readable = "inherit"

        Parameters

        • options: SpawnOptions<In, Out, Err> & { cmd: string[] }
          • cmd: string[]

            The command to run

            The first argument will be resolved to an absolute executable path. It must be a file, not a directory.

            If you explicitly set PATH in env, that PATH will be used to resolve the executable instead of the default PATH.

            To check if the command exists before running it, use Bun.which(bin).

            const subprocess = Bun.spawn(["echo", "hello"]);
            

        Returns Subprocess<In, Out, Err>

      • <
            const In extends Writable = "ignore",
            const Out extends Readable = "pipe",
            const Err extends Readable = "inherit",
        >(
            cmds: string[],
            options?: SpawnOptions<In, Out, Err>,
        ): Subprocess<In, Out, Err>
      • Spawn a new process

        const proc = Bun.spawn(["echo", "hello"]);
        const text = await proc.stdout.text();
        console.log(text); // "hello\n"

        Internally, this uses posix_spawn(2)

        Type Parameters

        • const In extends Writable = "ignore"
        • const Out extends Readable = "pipe"
        • const Err extends Readable = "inherit"

        Parameters

        • cmds: string[]

          The command to run

          The first argument will be resolved to an absolute executable path. It must be a file, not a directory.

          If you explicitly set PATH in env, that PATH will be used to resolve the executable instead of the default PATH.

          To check if the command exists before running it, use Bun.which(bin).

          const subprocess = Bun.spawn(["echo", "hello"]);
          
        • Optionaloptions: SpawnOptions<In, Out, Err>

        Returns Subprocess<In, Out, Err>