Skip to main content

close

function close
Jump to headingclose(): void

Exits the current Deno process.

This function terminates the process by signaling the runtime to exit. Similar to exit(0) in posix. Its behavior is similar to the window.close() method in the browser, but specific to the Deno runtime.

Note: Use this function cautiously, as it will stop the execution of the entire Deno program immediately.

Jump to heading

Example 1

console.log("About to close the Deno process.");
close(); // The process will terminate here.
console.log("This will not be logged."); // This line will never execute.

Return Type Jump to heading

void
Back to top