@darkobits/adeiu
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -5,2 +5,12 @@ # Change Log | ||
# [0.2.0](https://github.com/darkobits/adeiu/compare/v0.1.0...v0.2.0) (2019-04-23) | ||
### Features | ||
* Callbacks may be registered with a custom list of signals. ([eba691b](https://github.com/darkobits/adeiu/commit/eba691b)) | ||
* Log errors thrown by callbacks to stderr. ([efd9576](https://github.com/darkobits/adeiu/commit/efd9576)) | ||
# 0.1.0 (2019-04-18) | ||
@@ -7,0 +17,0 @@ |
{ | ||
"name": "@darkobits/adeiu", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Yet another POSIX signal handler.", | ||
@@ -35,6 +35,9 @@ "license": "WTFPL", | ||
], | ||
"engines": { | ||
"node": ">= 10.0.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "dist/index.js", | ||
"main": "dist/adeiu.js", | ||
"scripts": { | ||
@@ -46,7 +49,13 @@ "build": "nps build", | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"ow": "^0.12.0" | ||
}, | ||
"devDependencies": { | ||
"@darkobits/ts-unified": "^1.3.0", | ||
"@types/jest": "^24.0.11", | ||
"@types/node": "^11.13.2" | ||
"@types/node": "^11.13.2", | ||
"emittery": "^0.4.1", | ||
"p-wait-for": "^3.1.0" | ||
} | ||
} |
@@ -7,2 +7,3 @@ <a href="#top" id="top"> | ||
<a href="https://travis-ci.org/darkobits/adeiu"><img src="https://img.shields.io/travis/darkobits/adeiu.svg?style=flat-square"></a> | ||
<a href="https://www.codacy.com/app/darkobits/adeiu"><img src="https://img.shields.io/codacy/coverage/c18a33f1bf79468087b8a06ac8c645d2.svg?style=flat-square"></a> | ||
<a href="https://david-dm.org/darkobits/adeiu"><img src="https://img.shields.io/david/darkobits/adeiu.svg?style=flat-square"></a> | ||
@@ -45,1 +46,29 @@ <a href="https://github.com/conventional-changelog/standard-version"><img src="https://img.shields.io/badge/conventional%20commits-1.0.0-027dc6.svg?style=flat-square"></a> | ||
``` | ||
## Advanced Usage | ||
Usually, responding to signals dynamically can be accomplished by inspecting the `signal` argument passed to your callback. However, if it is important that listeners are _only_ installed on a particular signal, you may optionally provide a custom array of signals to assign a callback to. | ||
```ts | ||
import adeiu from '@darkobits/adeiu'; | ||
// Register callback that will only be invoked on SIGINT. | ||
adeiu(() => { | ||
// SIGINT cleanup tasks. | ||
}, ['SIGINT']); | ||
``` | ||
```ts | ||
import adeiu, {SIGNALS} from '@darkobits/adeiu'; | ||
// Register callback with the default signals and SIGUSR1. | ||
adeiu(() => { | ||
// Custom cleanup tasks. | ||
}, [...SIGNALS, 'SIGUSR1']); | ||
``` | ||
## | ||
<p align="center"> | ||
<br> | ||
<img width="24" height="24" src="https://cloud.githubusercontent.com/assets/441546/25318539/db2f4cf2-2845-11e7-8e10-ef97d91cd538.png"> | ||
</p> |
16226
97
73
2
5
+ Addedchalk@^2.4.2
+ Addedow@^0.12.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedow@0.12.0(transitive)
+ Addedsupports-color@5.5.0(transitive)