Enumeration of events emitted by the Process class.

Variables

@:value(cast "beforeExit")@:enum@:implinlineread onlyBeforeExit:ProcessEvent<Int ‑> Void> = "beforeExit"

Emitted when node empties it's event loop and has nothing else to schedule.

Normally, node exits when there is no work scheduled, but a listener for beforeExit can make asynchronous calls, and cause node to continue.

beforeExit is not emitted for conditions causing explicit termination, such as process.exit() or uncaught exceptions, and should not be used as an alternative to the exit event unless the intention is to schedule more work.

@:value(cast "exit")@:enum@:implinlineread onlyExit:ProcessEvent<Int ‑> Void> = "exit"

Emitted when the process is about to exit. There is no way to prevent the exiting of the event loop at this point, and once all exit listeners have finished running the process will exit. Therefore you must only perform synchronous operations in this handler. This is a good hook to perform checks on the module's state (like for unit tests). The callback takes one argument, the code the process is exiting with.

@:value(cast "uncaughtException")@:enum@:implinlineread onlyUncaughtException:ProcessEvent<Error ‑> Void> = "uncaughtException"

Emitted when an exception bubbles all the way back to the event loop. If a listener is added for this exception, the default action (which is to print a stack trace and exit) will not occur.