A task queue for handling interrupt signals in Deno.
- Register tasks to be executed in sequence upon interrupt signals.
- Handles
SIGINT
andSIGTERM
signals gracefully. - Provides a globally accessible task queue via import.
For Deno:
$ deno add @117/interrupt
import { addTask } from "@117/interrupt";
addTask(() => console.log("goodbye"));
addTask(() => console.log("goodbye, for real this time"));
console.log("app is running, press ctrl+c to exit");
Feel free to contribute and PR to your 💖's content.