Skip to main content

shell.Child

Constructors#

constructor#

+ new Child(pid: number): Child

Parameters:#

NameType
pidnumber

Returns: Child

Defined in: shell.ts:115

Properties#

pid#

pid: number

The child process pid.

Defined in: shell.ts:115

Methods#

kill#

kill(): Promise<void>

Kills the child process.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: shell.ts:151


write#

write(data: string | number[]): 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])

Parameters:#

NameTypeDescription
datastring | number[]The message to write, either a string or a byte array.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: shell.ts:135