@beenotung/tslib
Version:
utils library in Typescript
25 lines (24 loc) • 735 B
TypeScript
import { exec as _exec, SpawnOptionsWithoutStdio } from 'child_process';
export declare const exec: typeof _exec.__promisify__;
export declare function spawn(options: {
cmd: string;
args?: string[];
options?: SpawnOptionsWithoutStdio;
on_stdout?: (chunk: any) => void;
on_stderr?: (chunk: any) => void;
on_error?: (error: any) => void;
}): Promise<number | null>;
/**
* spawn a child process and return the stdout and stderr in promise
*
* the console is not used to output the stdout and stderr
*/
export declare function spawnAndWait(options: {
cmd: string;
args: string[];
options?: SpawnOptionsWithoutStdio;
}): Promise<{
code: number | null;
stdout: string;
stderr: string;
}>;