Effection Logo

function exit

thefrontside/effection

function* exit(status: number, message?: string): Operation<void>

Halt process execution immediately and initiate shutdown. If a message is provided, it will be logged to the console after shutdown:

if (invalidArgs()) {
  yield* exit(5, "invalid arguments")
}

Parameters

status: number

  • the exit code to use for the process exit

messageoptional: string

  • message to print to the console before exiting.

Return Type

Operation<void>