shell.Child
#
Constructors#
constructor• new Child(pid
)
#
ParametersName | Type |
---|---|
pid | number |
#
Defined in#
Properties#
pid• pid: number
The child process pid
.
#
Defined in#
Methods#
kill▸ kill(): Promise
<void
>
Kills the child process.
#
ReturnsPromise
<void
>
A promise indicating the success or failure of the operation.
#
Defined in#
write▸ write(data
): Promise
<void
>
Writes data
to the stdin
.
example
const command = new Command('node')
const child = await command.spawn()
await child.write('message')
await child.write([0, 1, 2, 3, 4, 5])
#
ParametersName | Type | Description |
---|---|---|
data | string | number [] | The message to write, either a string or a byte array. |
#
ReturnsPromise
<void
>
A promise indicating the success or failure of the operation.