UtilityProcess

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
external object Companion

Properties

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

A Integer | undefined representing the process identifier (PID) of the child process. Until the child process has spawned successfully, 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
external var stderr: ReadableStream?

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
external var stdout: ReadableStream?

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
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
external 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
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external 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
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun setMaxListeners(n: Number)