Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/effection/lib/mod.ts>exit

Structured concurrency and effects for JavaScript
Latest
function exit
import { exit } from "https://deno.land/x/effection@4.0.0-alpha.1/lib/mod.ts";

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
optional
message: string
  • message to print to the console before exiting.