Deprecated
Use Deno.addSignalListener and Deno.removeSignalListener instead.
import { onSignal } from "https://dotland.deno.dev/std@0.116.0/signal/mod.ts";
Registers a callback function to be called on triggering of a signal event.
import { onSignal } from "./mod.ts";
const handle = onSignal("SIGINT", () => {
console.log('Received SIGINT');
handle.dispose(); // de-register from receiving further events
});