shell-exec
Version:
A tiny cross-platform promise based wrapper around child_process.spawn.
20 lines (17 loc) • 542 B
TypeScript
import * as childProcess from 'child_process';
declare type Command = string | string[];
interface CmdResult {
code?: number | null;
stdout: string;
stderr: string;
error?: Error;
cmd: string;
}
interface FailedExec extends CmdResult {
error: Error;
}
interface SuccessfulExec extends CmdResult {
code: number | null;
}
declare function shellExec(cmd: Command, opts?: Omit<childProcess.SpawnOptionsWithoutStdio, "stdio" | "cwd">): Promise<CmdResult>;
export { FailedExec, SuccessfulExec, shellExec as default };