Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/lib.deno.d.ts>Deno.addSignalListener

A JavaScript extension package for building strong and modern applications.
Latest
function Deno.addSignalListener
import { Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { addSignalListener } = Deno;

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