Run a command and capture it's return status.
const system =// run ls -l, dumping output to stdout, returning status codeconst status = await// also available in synchronous versionconst status = system// and with callbacks// or don't pass the command to a shellconst status = await// avoiding the shell without argumentsconst status = await
system(cmd[, args][, cb]) → Promise(status)
cmd to a shell to execute. We use
do this in a platform compatible manner. As this is a shell command it's up
to you to quote spaces and escape special characters.
cmd is called directly and
args is passed in via OS
facilities (so you don't need to provide quoting or escaping).
system, synchronous and just returns the status.
This is intended to provide the same functionality as the Perl system function.
In contrast with Perl's system call, this does not currently encode the signal that killed the process in the return value.