ForkedProcess
Defined in: packages/node/src/process/fork-process.ts:59
A forked Node module: everything a SpawnedProcess offers, plus the IPC
channel fork opens.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ForkedProcess(
child,startedAt,options?):ForkedProcess
Defined in: packages/node/src/process/fork-process.ts:60
Parameters
Section titled “Parameters”ChildProcess
startedAt
Section titled “startedAt”number
options?
Section titled “options?”Returns
Section titled “Returns”ForkedProcess
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get pid():
number|undefined
Defined in: packages/node/src/process/spawned-process.ts:85
Returns
Section titled “Returns”number | undefined
Inherited from
Section titled “Inherited from”stderr
Section titled “stderr”Get Signature
Section titled “Get Signature”get stderr():
ReadableStream<Uint8Array<ArrayBufferLike>> |null
Defined in: packages/node/src/process/spawned-process.ts:96
The child’s standard error, null unless it was piped.
Returns
Section titled “Returns”ReadableStream<Uint8Array<ArrayBufferLike>> | null
Inherited from
Section titled “Inherited from”stdout
Section titled “stdout”Get Signature
Section titled “Get Signature”get stdout():
ReadableStream<Uint8Array<ArrayBufferLike>> |null
Defined in: packages/node/src/process/spawned-process.ts:90
The child’s standard output, null unless it was piped.
Returns
Section titled “Returns”ReadableStream<Uint8Array<ArrayBufferLike>> | null
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[asyncDispose]()
Section titled “[asyncDispose]()”[asyncDispose]():
Promise<void>
Defined in: packages/node/src/process/spawned-process.ts:189
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”isSubscribed()
Section titled “isSubscribed()”isSubscribed<
K>(event,listener):boolean
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:38
Check if a callback is subscribed to a specific event.
Type Parameters
Section titled “Type Parameters”K extends "message" | "output"
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<ForkedProcessEvents[K]>
The callback to check.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”kill()
Section titled “kill()”kill(
signal?):boolean
Defined in: packages/node/src/process/spawned-process.ts:185
Sends one signal and returns, with no escalation — for signals that mean something to the child other than “shut down”.
Parameters
Section titled “Parameters”signal?
Section titled “signal?”Signals = "SIGTERM"
Defaults to SIGTERM.
Returns
Section titled “Returns”boolean
Whether the signal was delivered.
Inherited from
Section titled “Inherited from”send()
Section titled “send()”send(
message,signal?):Promise<void>
Defined in: packages/node/src/process/fork-process.ts:80
Sends a message to the child.
Parameters
Section titled “Parameters”message
Section titled “message”Serializable
Anything the configured serialization can carry.
signal?
Section titled “signal?”AbortSignal | null
Abandons the send.
Returns
Section titled “Returns”Promise<void>
A promise resolving once the message has been handed to the OS.
subscribe()
Section titled “subscribe()”subscribe<
K>(event,listener,options?):Callable|null
Defined in: packages/node/src/process/spawned-process.ts:111
Type Parameters
Section titled “Type Parameters”K extends "message" | "output"
Parameters
Section titled “Parameters”K
listener
Section titled “listener”Callable<ForkedProcessEvents[K]>
options?
Section titled “options?”EventDispatcherSubscribeOptions
Returns
Section titled “Returns”Callable | null
Inherited from
Section titled “Inherited from”terminate()
Section titled “terminate()”terminate(
graceMs?):Promise<ProcessExit>
Defined in: packages/node/src/process/spawned-process.ts:160
Sends SIGTERM, then SIGKILL if the child is still alive after
graceMs. Idempotent: concurrent and repeated calls share one escalation.
Parameters
Section titled “Parameters”graceMs?
Section titled “graceMs?”number
Overrides the grace period given at spawn time.
Returns
Section titled “Returns”Promise<ProcessExit>
The child’s exit, once it has happened.
Inherited from
Section titled “Inherited from”unsubscribe()
Section titled “unsubscribe()”unsubscribe<
K>(event,listener):void
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:31
Unsubscribe a callback from a specific event.
Type Parameters
Section titled “Type Parameters”K extends "message" | "output"
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<ForkedProcessEvents[K]>
The callback to remove.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”wait()
Section titled “wait()”wait<
K>(event,options?):Promise<ForkedProcessEvents[K]>
Defined in: packages/node/src/process/spawned-process.ts:120
Type Parameters
Section titled “Type Parameters”K extends "message" | "output"
Parameters
Section titled “Parameters”K
options?
Section titled “options?”EventDispatcherWaitOptions<ForkedProcessEvents[K]>
Returns
Section titled “Returns”Promise<ForkedProcessEvents[K]>
Inherited from
Section titled “Inherited from”waitForExit()
Section titled “waitForExit()”waitForExit(
signal?):Promise<ProcessExit>
Defined in: packages/node/src/process/spawned-process.ts:134
Resolves once the child has exited, immediately if it already has.
Parameters
Section titled “Parameters”signal?
Section titled “signal?”AbortSignal | null
Abandons the wait; the child is left running.
Returns
Section titled “Returns”Promise<ProcessExit>
The exit code, terminating signal and wall-clock duration.