介面:Exec
目錄
可呼叫
執行
▸ Exec(cmd
, args
, options?
): Promise
<ExecResult
>
執行命令。
自
0.2.0
引數
名稱 | 型別 | 描述 |
---|---|---|
命令 | 字串 | 要執行的命令。 |
args | 字串 [] | 要執行命令的引數。 |
選項? | ExecOptions | 選項列表。 |
返回
Promise
<ExecResult
>
命令完成時將解析的 Promise。
執行
▸ Exec(cmd
, args
, options
): ExecProcess
如果 options
引數中指定了 stream
,則流式傳輸命令結果。
如果您的命令輸出過長,或者您需要無限期地流式傳輸(例如容器日誌),請指定 stream
。
自
0.2.2
引數
名稱 | 型別 | 描述 |
---|---|---|
命令 | 字串 | 要執行的命令。 |
args | 字串 [] | 要執行命令的引數。 |
options | SpawnOptions | 選項列表。 |
返回
已生成的程序。