@eljs/utils
Version:
Collection of nodejs utility.
45 lines • 1.26 kB
TypeScript
import { type ExecaChildProcess, type Options as ExecaOptions } from 'execa';
/**
* 解析命令
* @param command 可执行的命令
*/
export declare function parseCommand(command: string): string[];
/**
* 运行命令选项
*/
export interface RunCommandOptions extends ExecaOptions {
/**
* 是否打印命令
*/
verbose?: boolean;
}
/**
* 运行命令子进程
*/
export type RunCommandChildProcess = ExecaChildProcess;
/**
* 运行命令
* @param command 命令名称
* @param options 选项
*/
export declare function run(command: string, options?: RunCommandOptions): RunCommandChildProcess;
/**
* 运行命令
* @param command 命令名称
* @param args 命令行参数
* @param options 选项
*/
export declare function run(command: string, args: string[], options?: RunCommandOptions): RunCommandChildProcess;
/**
* 运行命令
* @param command 命令名称
* @param options 选项
*/
export declare function runCommand(command: string, options?: RunCommandOptions): RunCommandChildProcess;
/**
* 获取可执行的命令
* @param target 命令
* @param dirs 文件夹
*/
export declare function getExecutableCommand(target: string, dirs?: string[]): Promise<string | null>;
//# sourceMappingURL=command.d.ts.map