Skip to main content

Module exec_file

Module exec_file 

Source
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§

ExecAttempt
The program ran and said something. failure is set when it exited non-zero — the output is still there, because Node hangs stdout on the error object and one caller reads it.
ExecOptions
ExecOutput

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.