Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/117/interrupt
A task queue for handling interrupt signals in Deno.
https://github.com/117/interrupt
Last synced: 10 days 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 (14 days ago)
- Default Branch: main
- Last Pushed: 2024-12-11T05:55:07.000Z (14 days ago)
- Last Synced: 2024-12-11T06:32:11.442Z (14 days ago)
- Language: TypeScript
- Homepage:
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# interrupt
![version](https://img.shields.io/jsr/v/%40117/interrupt?style=flat-square&color=%23ff51bc&label=version)
![status](https://img.shields.io/github/actions/workflow/status/117/interrupt/deploy.yml?style=flat-square)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 { 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");
```## Contributing
Feel free to contribute and PR to your 💖's content.