Expand description
execFile, including how it reports a failure.
Several surfaces run a program, hand the caller its output, and hand the
caller Node’s own failure wording when it exits non-zero — the message is
rendered where the output would have gone, so it is part of the answer
rather than a log line. Node words it
Command failed: <file> <args…>\n<stderr>, which means the full argv is
quoted back, embedded remote scripts and all.
Bytes rather than a String, because a file preview may be binary and the
caller decides how to decode it. The one place a lossy decode is forced is
the error message, which is text by construction.
Structs§
- Exec
Attempt - The program ran and said something.
failureis set when it exited non-zero — the output is still there, because Node hangsstdouton the error object and one caller reads it. - Exec
Options - Exec
Output
Functions§
- exec_
file - The common case: a non-zero exit is a failure and the output is discarded.
- exec_
file_ capturing - Run a program, and hand back what it printed even when it failed.