UNPKG

lerna

Version:

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository

58 lines (57 loc) • 1.78 kB
export { colorize, type StyleFormat } from "./colorize"; import { type ExecaError, type Options, type Result, type Subprocess, type SyncOptions } from "execa"; type withPkg<T> = T & { pkg?: unknown; }; type LernaExecaOptions = Omit<Options, "encoding" | "cwd"> & { encoding?: string; cwd?: string; }; type LernaSyncOptions = Omit<SyncOptions, "encoding"> & { encoding?: string; }; type LernaResult = Result & { stdout: string; stderr: string; }; export type LernaChildProcess = withPkg<Subprocess>; export type LernaReturnValue = withPkg<LernaResult>; export type LernaOptions = withPkg<LernaExecaOptions>; /** * Execute a command asynchronously, piping stdio by default. * @param command * @param args * @param opts * @returns */ export declare function exec(command: string, args: string[], opts?: LernaOptions): Promise<LernaReturnValue>; /** * Execute a command synchronously. * @param command * @param args * @param opts */ export declare function execSync(command: string, args: string[], opts?: LernaSyncOptions): string; /** * Spawn a command asynchronously, _always_ inheriting stdio. * @param command * @param args * @param opts */ export declare function spawn(command: string, args: string[], opts?: LernaOptions): Promise<LernaReturnValue>; /** * Spawn a command asynchronously, streaming stdio with optional prefix. * @param command * @param args * @param opts * @param prefix */ export declare function spawnStreaming(command: string, args: string[], opts?: LernaOptions, prefix?: string): Promise<LernaReturnValue>; export declare function getChildProcessCount(): number; /** * @param result * @returns */ export declare function getExitCode(result: ExecaError & { code?: string | number; }): number | undefined;