介面:Exec
目錄
可呼叫
Exec
▸ Exec(cmd
, args
, options?
): Promise
< ExecResult
>
執行指令。
自
0.2.0
參數
名稱 | 類型 | 說明 |
---|---|---|
cmd | string | 要執行的指令。 |
args | string [] | 要執行的指令的參數。 |
options? | ExecOptions | 選項列表。 |
回傳
Promise
< ExecResult
>
指令完成後將會解析的 promise。
Exec
▸ Exec(cmd
, args
, options
): ExecProcess
如果在 options
參數中指定了 stream
,則會串流指令的結果。
如果指令的輸出過長或需要無限期地串流資料(例如容器日誌),請指定 stream
。
自
0.2.2
參數
名稱 | 類型 | 說明 |
---|---|---|
cmd | string | 要執行的指令。 |
args | string [] | 要執行的指令的參數。 |
options | SpawnOptions | 選項列表。 |
回傳
衍生的程序。