https://github.com/117/interrupt
A task queue for handling interrupt signals in Deno.
https://github.com/117/interrupt
Last synced: 3 months ago
JSON representation
A task queue for handling interrupt signals in Deno.
- Host: GitHub
- URL: https://github.com/117/interrupt
- Owner: 117
- License: mit
- Created: 2024-12-11T05:50:00.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-16T06:56:35.000Z (6 months ago)
- Last Synced: 2025-02-08T12:46:35.648Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# interrupt

A task queue for handling interrupt signals in Deno.
## Contents
- [Features](#features)
- [Install](#install)
- [Usage](#usage)
- [Contributing](#contributing)## Features
- [x] Register tasks to be executed in sequence upon interrupt signals.
- [x] Handles `SIGINT` and `SIGTERM` signals gracefully.
- [x] Provides a globally accessible task queue via import.## Install
For Deno:
```sh
$ deno add @117/interrupt
```## Example
```ts
import { onInterrupt } from "@117/interrupt";onInterrupt(() => console.log("goodbye"));
onInterrupt(() => console.log("goodbye, for real this time"));console.log("app is running, press ctrl+c to exit");
```## Contributing
Feel free to contribute and PR to your 💖's content.