Deno.addSignalListener

UNSTABLE: new API, yet to be vetted.

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

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

NOTE: This functionality is not yet implemented on Windows.

function addSignalListener(signal: Signal, handler: () => void): void;
§
addSignalListener(signal: Signal, handler: () => void): void
[src]

§Parameters

§
signal: Signal
[src]
§
handler: () => void
[src]

§Return Type