How to exit the Deno process
In this tutorial, we are going to learn about two different ways to exit the deno process.
Manually exiting the process
If you want to exit the process manually in a command line, you can use the ctrl+c
keyboard shortcut.
Programmatically exiting the process
If you want to exit the process from a deno program, you can use the Deno.exit()
method.
Deno.exit(); // exits with success code 0
It also accepts exit code
as an optional argument. If no code is provided then deno will exit with a success code 0
. Failure is indicated with the non-zero exit codes.
Deno.exit(1); // exits with failure code 1