Skip to content

Classes

CommandHandle

A background command.

readonly id: string

Name of the command’s state directory.


readonly pid: number

Process group leader’s pid in the sandbox.

get exitCode(): number | undefined

The exit code once known.

number | undefined


get stderr(): string

string


get stdout(): string

Standard output received so far.

string

kill(): Promise<boolean>

SIGKILL the command’s process group; the exit code becomes 137. Resolves false if it had already exited.

Promise<boolean>


poll(): Promise<number | undefined>

Fetch new output; resolves the exit code, or undefined while it runs.

Promise<number | undefined>


wait(opts?): Promise<CommandResult>

Wait for the command to exit, passing output to the callbacks as it arrives (about every 2 s), starting with output fetched earlier. Output a concurrent poll() fetches is delivered too, once and in order. Rejects with CommandExitError on a non-zero exit.

(data) => void

(data) => void

Promise<CommandResult>