mirror of
https://github.com/tauri-apps/tauri-docs.git
synced 2026-01-31 00:35:16 +01:00
1.2 KiB
1.2 KiB
@tauri-apps/api / shell / Child
Class: Child
shell.Child
Constructors
constructor
new Child(pid)
Parameters
| Name | Type |
|---|---|
pid |
number |
Properties
pid
pid: number
The child process pid.
Defined in
Methods
kill
kill(): Promise<void>
Kills the child process.
Returns
Promise<void>
A promise indicating the success or failure of the operation.
write
write(data): Promise<void>
Writes data to the stdin.
Example
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]);
Parameters
| Name | Type | Description |
|---|---|---|
data |
string | Uint8Array |
The message to write, either a string or a byte array. |
Returns
Promise<void>
A promise indicating the success or failure of the operation.