by Sai gowtham

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

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
26,545 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
221,520 students enrolled
44 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
114,575 students enrolled
21 hours of video content
View Course