Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
function Deno.addSignalListener

Registers the given function as a listener of the given signal event.

Deno.addSignalListener(
  "SIGTERM",
  () => {
    console.log("SIGTERM!")
  }
);

Note: On Windows only "SIGINT" (CTRL+C) and "SIGBREAK" (CTRL+Break) are supported.

Parameters

signal: Signal
handler: () => void