接口: Exec

Callable

Exec

Exec(cmd, args, options?): Promise< ExecResult>

执行一个命令。

Since

0.2.0

参数

NameTypeDescription
cmdstringThe command to execute.
argsstring[]The arguments of the command to execute.
options?ExecOptionsThe list of options.

返回

Promise< ExecResult>

一个承诺,一旦命令完成就会解决。

Exec

执行(cmd, args, options): ExecProcess

如果在options参数中指定了stream,则流式传输命令的结果。

如果命令的输出太长或者需要无限流式传输(例如容器日志),请指定stream

Since

0.2.2

参数

NameTypeDescription
cmdstringThe command to execute.
argsstring[]The arguments of the command to execute.
optionsSpawnOptionsThe list of options.

返回

ExecProcess

生成的进程。