UNPKG

@conventional-changelog/git-client

Version:
47 lines 1.5 kB
/// <reference types="node" resolution-mode="require"/> /// <reference types="node" resolution-mode="require"/> /// <reference types="node" resolution-mode="require"/> import { type SpawnOptionsWithoutStdio } from 'child_process'; import type { Arg } from './types.js'; /** * Spawn child process and return stdout stream. * @param cmd * @param args * @param options * @yields Stdout chunks. */ export declare function stdoutSpawn(cmd: string, args: string[], options?: SpawnOptionsWithoutStdio): AsyncGenerator<Buffer, void, undefined>; /** * Spawn child process. * @param cmd * @param args * @param options * @returns Process output. */ export declare function spawn(cmd: string, args: string[], options?: SpawnOptionsWithoutStdio): Promise<Buffer>; /** * Split stream by separator. * @param stream * @param separator * @yields String chunks. */ export declare function splitStream(stream: AsyncIterable<string | Buffer>, separator: string): AsyncGenerator<string, void, undefined>; /** * Return first element of a stream * @param stream * @returns First element or null if empty */ export declare function getFirstFromStream<T>(stream: AsyncIterable<T>): Promise<T | null>; /** * Format arguments. * @param args * @returns Formatted arguments. */ export declare function formatArgs(...args: Arg[]): string[]; /** * Convert value to array. * @param value * @returns Array. */ export declare function toArray<T>(value: T | T[]): T[]; //# sourceMappingURL=utils.d.ts.map