Tauri Child

2024-02-05 16:40 更新
Since: 1.1.0

構(gòu)造 函數(shù)

?constructor?

new Child(: ): Childpidnumber

參數(shù)

名字類(lèi)型
pidnumber

Defined in: shell.ts:325

性能

?pid??
PID:?number?

子進(jìn)程 。pid

Defined in: shell.ts:323

方法

?kill?

kill(): Promise<void>

終止子進(jìn)程。

Returns: Promise<void>

指示操作成功或失敗的承諾。

?write?

write(: | Uint8Array): Promisedatastring<void>

寫(xiě)入 .?data??stdin?

import { Command } from '@tauri-apps/api/shell';
const command = new Command('node');
const child = await command.spawn();
await child.write('message');
await child.write([0, 1, 2, 3, 4, 5]);

參數(shù)

名字類(lèi)型描述
datastring | Uint8數(shù)組要寫(xiě)入的消息,可以是字符串,也可以是字節(jié)數(shù)組。

Returns: Promise<void>

指示操作成功或失敗的承諾。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)