UtilityProcess

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var pid: Double?

A Integer | undefined representing the process identifier (PID) of the child process. If the child process fails to spawn due to errors, then the value is undefined. When the child process exits, then the value is undefined after the exit event is emitted.

Link copied to clipboard
Link copied to clipboard

A NodeJS.ReadableStream | null that represents the child process's stderr. If the child was spawned with options.stdio2 set to anything other than 'pipe', then this will be null. When the child process exits, then the value is null after the exit event is emitted.

Link copied to clipboard

A NodeJS.ReadableStream | null that represents the child process's stdout. If the child was spawned with options.stdio1 set to anything other than 'pipe', then this will be null. When the child process exits, then the value is null after the exit event is emitted.

Functions

Link copied to clipboard
fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun kill(): Boolean

Terminates the process gracefully. On POSIX, it uses SIGTERM but will ensure the process is reaped on exit. This function returns true if the kill is successful, and false otherwise.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun off(type: EventType, listener: EventListener)
Link copied to clipboard
fun on(type: EventType, listener: EventListener)
Link copied to clipboard
fun once(type: EventType, listener: EventListener)
Link copied to clipboard
fun postMessage(message: Any?, transfer: ReadonlyArray<MessagePortMain> = definedExternally)

Send a message to the child process, optionally transferring ownership of zero or more MessagePortMain objects.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard