接口: Exec
目录
Callable
Exec
▸ Exec(cmd, args, options?): Promise<
ExecResult>
执行一个命令。
Since
0.2.0
参数
| Name | Type | Description |
|---|---|---|
cmd | string | The command to execute. |
args | string[] | The arguments of the command to execute. |
options? | ExecOptions | The list of options. |
返回
Promise<
ExecResult>
一个承诺,一旦命令完成就会解决。
Exec
▸ 执行(cmd, args, options):
ExecProcess
如果在options参数中指定了stream,则流式传输命令的结果。
如果命令的输出太长或者需要无限流式传输(例如容器日志),请指定stream。
Since
0.2.2
参数
| Name | Type | Description |
|---|---|---|
cmd | string | The command to execute. |
args | string[] | The arguments of the command to execute. |
options | SpawnOptions | The list of options. |
返回
生成的进程。