Classes
CommandHandle
A background command.
Properties
Section titled “Properties”
readonlyid:string
Name of the command’s state directory.
readonlypid:number
Process group leader’s pid in the sandbox.
Accessors
Section titled “Accessors”exitCode
Section titled “exitCode”Get Signature
Section titled “Get Signature”get exitCode():
number|undefined
The exit code once known.
Returns
Section titled “Returns”number | undefined
stderr
Section titled “stderr”Get Signature
Section titled “Get Signature”get stderr():
string
Returns
Section titled “Returns”string
stdout
Section titled “stdout”Get Signature
Section titled “Get Signature”get stdout():
string
Standard output received so far.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”kill()
Section titled “kill()”kill():
Promise<boolean>
SIGKILL the command’s process group; the exit code becomes 137. Resolves false if it had already exited.
Returns
Section titled “Returns”Promise<boolean>
poll()
Section titled “poll()”poll():
Promise<number|undefined>
Fetch new output; resolves the exit code, or undefined while it runs.
Returns
Section titled “Returns”Promise<number | undefined>
wait()
Section titled “wait()”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.
Parameters
Section titled “Parameters”onStderr?
Section titled “onStderr?”(data) => void
onStdout?
Section titled “onStdout?”(data) => void
Returns
Section titled “Returns”Promise<CommandResult>
