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[src]
handler: () => void[src]