@xec-sh/core
Version:
Universal shell execution engine
19 lines (18 loc) • 1 kB
TypeScript
import { Writable, Transform } from 'node:stream';
import type { Command } from './command.js';
import type { ExecutionResult } from './result.js';
import type { ProcessPromise, ExecutionEngine } from './execution-engine.js';
export type PipeTarget = string | Command | TemplateStringsArray | ProcessPromise | Transform | Writable | ((line: string) => void | Promise<void>) | ((result: ExecutionResult) => Command | string | null);
export interface PipeOptions {
throwOnError?: boolean;
encoding?: BufferEncoding;
lineByLine?: boolean;
lineSeparator?: string;
}
export declare function executePipe(source: ProcessPromise | Promise<ExecutionResult>, target: PipeTarget, engine: ExecutionEngine, options?: PipeOptions, ...templateArgs: any[]): Promise<any>;
export declare const pipeUtils: {
toUpperCase(): Transform;
grep(pattern: string | RegExp): Transform;
replace(search: string | RegExp, replacement: string): Transform;
tee(...destinations: Writable[]): Transform;
};