Skip to main content
ChildProcess.prototype.on - child_process - Node documentation
method ChildProcess.prototype.on

Usage in Deno

import { ChildProcess } from "node:child_process";
ChildProcess.prototype.on(
event: string,
listener: (...args: any[]) => void,
): this

Parameters

event: string
listener: (...args: any[]) => void

Return Type

this
ChildProcess.prototype.on(
event: "close",
listener: (
code: number | null,
signal: Signals | null,
) => void
,
): this

Parameters

event: "close"
listener: (
code: number | null,
signal: Signals | null,
) => void

Return Type

this
ChildProcess.prototype.on(
event: "disconnect",
listener: () => void,
): this

Parameters

event: "disconnect"
listener: () => void

Return Type

this
ChildProcess.prototype.on(
event: "error",
listener: (err: Error) => void,
): this

Parameters

event: "error"
listener: (err: Error) => void

Return Type

this
ChildProcess.prototype.on(
event: "exit",
listener: (
code: number | null,
signal: Signals | null,
) => void
,
): this

Parameters

event: "exit"
listener: (
code: number | null,
signal: Signals | null,
) => void

Return Type

this
ChildProcess.prototype.on(
event: "message",
listener: (
message: Serializable,
sendHandle: SendHandle,
) => void
,
): this

Parameters

event: "message"
listener: (
message: Serializable,
sendHandle: SendHandle,
) => void

Return Type

this
ChildProcess.prototype.on(
event: "spawn",
listener: () => void,
): this

Parameters

event: "spawn"
listener: () => void

Return Type

this