UNPKG

nxkit

Version:

This is a collection of tools, independent of any other libraries

25 lines (24 loc) 975 B
/// <reference types="node" /> import * as child_process from 'child_process'; import * as stream from 'stream'; export declare function syscall(cmd: string): SpawnResult; export declare function execSync(cmd: string): SpawnResult; export declare function spawnSync(cmd: string, args?: string[]): SpawnResult; export interface SpawnOptions { onData?: (data: Buffer) => string; onError?: (data: Buffer) => string; stdout?: stream.Writable; stderr?: stream.Writable; stdin?: stream.Readable; } export interface SpawnResult { code: number; first: string; stdout: string[]; stderr: string[]; } export interface SpawnPromise extends Promise<SpawnResult> { process: child_process.ChildProcessByStdio<stream.Writable, stream.Readable, stream.Readable> | null; } export declare function exec(cmd: string, options?: SpawnOptions): SpawnPromise; export declare function spawn(cmd: string, args?: string[], options?: SpawnOptions): SpawnPromise;