Skip to content

startProcess

startProcess(command, args?, options?): Promise<SpawnedProcess<SpawnedProcessEvents>>

Defined in: packages/node/src/process/start-process.ts:67

Spawns a command and resolves once it is running.

Nothing in args can be interpreted as a command unless shell is set, so the default form is safe with untrusted arguments.

string

The executable to run.

readonly string[]

Arguments passed to it verbatim.

StartProcessOptions

Streams, environment, cancellation. See StartProcessOptions.

Promise<SpawnedProcess<SpawnedProcessEvents>>

A handle over the running child.

await using child = await startProcess("tail", ["-f", "app.log"]);
child.subscribe("output", (_stream, line) => console.log(line));
```;
## Throws
When the command cannot be spawned.