OptionalbunOptionalgraceSIGTERM first (bench-serve stops its servers and saves the run), then SIGKILL after this. Default 70 s.
OptionalnowOptionalscriptbench-serve.ts; default the checkout's.
OptionalspawnTest seam for process creation.
Spawn a new process
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).
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)
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).
Optionaloptions: SpawnOptions<In, Out, Err>
The Bun executable that runs it; default the one on PATH.