• execute a command and return its result

    differences from node's child_process.exec():

    • if options.stdio is set to 'inherit', the command will be printed to the console (unless options.quiet is set to true)
    • on non-zero exit code, the promise will be rejected with an error if options.throwOnError is set to true

    Parameters

    • cmd: string[]

      command to execute (first element is the command itself, the rest are arguments to it)

    • Optionaloptions: SpawnOptions & { quiet?: boolean; throwOnError?: boolean }

    Returns Promise<ExecResult>