Interface ExecaReturnValue<StdoutErrorType>

Result of a child process execution. On success this is a plain object. On failure this is also an Error instance.

The child process fails when:

  • its exit code is not 0
  • it was killed with a signal
  • timing out
  • being canceled
  • there's not enough memory or there are already too many child processes
interface ExecaReturnValue<StdoutErrorType> {
    all?: StdoutErrorType;
    command: string;
    exitCode: number;
    failed: boolean;
    isCanceled: boolean;
    killed: boolean;
    signal?: string;
    signalDescription?: string;
    stderr: StdoutErrorType;
    stdout: StdoutErrorType;
    timedOut: boolean;
}

Type Parameters

  • StdoutErrorType = string

Hierarchy (view full)

Properties

The output of the process with stdout and stderr interleaved.

This is undefined if either:

  • the all option is false (default value)
  • execa.sync() was used
command: string

The file and arguments that were run.

exitCode: number

The numeric exit code of the process that was run.

failed: boolean

Whether the process failed to run.

isCanceled: boolean

Whether the process was canceled.

killed: boolean

Whether the process was killed.

signal?: string

The name of the signal that was used to terminate the process. For example, SIGFPE.

If a signal terminated the process, this property is defined and included in the error message. Otherwise it is undefined.

signalDescription?: string

A human-friendly description of the signal that was used to terminate the process. For example, Floating point arithmetic error.

If a signal terminated the process, this property is defined and included in the error message. Otherwise it is undefined. It is also undefined when the signal is very uncommon which should seldomly happen.

The output of the process on stderr.

The output of the process on stdout.

timedOut: boolean

Whether the process timed out.