@darkobits/adeiu
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -1,5 +0,9 @@ | ||
# Change Log | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
### [0.2.2](https://github.com/darkobits/adeiu/compare/v0.2.1...v0.2.2) (2019-06-07) | ||
## [0.2.1](https://github.com/darkobits/adeiu/compare/v0.2.0...v0.2.1) (2019-04-23) | ||
@@ -6,0 +10,0 @@ |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
/** | ||
* Optional options object that may be passed to Adeiu. | ||
* Optional options object that may be passed to `adeiu`. | ||
*/ | ||
@@ -19,3 +19,3 @@ export interface AdeiuOptions { | ||
/** | ||
* List of POSIX signals to register handlers for by default. | ||
* List of default POSIX signals to register handlers for. | ||
*/ | ||
@@ -22,0 +22,0 @@ export declare const SIGNALS: Array<NodeJS.Signals>; |
@@ -19,6 +19,6 @@ "use strict"; | ||
function writeErrorToSterr(cb, err) { | ||
function writeErrorToStderr(cb, signal, err) { | ||
if (err && err.stack) { | ||
const errType = err.constructor ? err.constructor.name : 'Error'; | ||
const cbName = cb.name ? `Callback \`${cb.name}\`` : 'Anonymous callback'; | ||
const cbName = cb.name ? `${signal} handler \`${cb.name}\`` : 'Anonymous callback'; | ||
const stackLines = err.stack.split('\n'); | ||
@@ -42,3 +42,3 @@ stackLines[0] = `${_chalk.default.red(`Error: [adeiu] ${cbName} threw:`)} ${errType}: ${err.message}`; | ||
} catch (err) { | ||
writeErrorToSterr(cb, err); | ||
writeErrorToStderr(cb, signal, err); | ||
return false; | ||
@@ -45,0 +45,0 @@ } |
{ | ||
"name": "@darkobits/adeiu", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Yet another POSIX signal handler.", | ||
@@ -53,5 +53,5 @@ "license": "WTFPL", | ||
"devDependencies": { | ||
"@darkobits/ts-unified": "^1.3.0", | ||
"@types/jest": "^24.0.11", | ||
"@types/node": "^11.13.2", | ||
"@darkobits/ts-unified": "^1.6.0", | ||
"@types/jest": "^24.0.13", | ||
"@types/node": "^11.13.13", | ||
"emittery": "^0.4.1", | ||
@@ -58,0 +58,0 @@ "p-wait-for": "^3.1.0" |
@@ -17,6 +17,7 @@ <a href="#top" id="top"> | ||
* Runs any combination of synchronous and asynchronous callbacks concurrently. | ||
* Ensures a clean exit if all callbacks resolve/return. | ||
* Exit with an error if any callbcks reject/throw. | ||
* Ensures processes exit cleanly, even when they have asynchronous callbacks and the Node debugger is in use. (See [this issue](https://github.com/nodejs/node/issues/7742). | ||
* Ensures provided functions are called before any other event listeners and are run concurrently, minimizing shutdown time. | ||
* Works with any combination of synchronous and asynchronous functions. | ||
* Ensures a clean exit if all functions resolve/return. | ||
* Exits with an error if any functions reject/throw. | ||
* Ensures processes exit cleanly, even when they have asynchronous shut-down functions and the Node debugger is in use. (See [this issue](https://github.com/nodejs/node/issues/7742)) | ||
@@ -23,0 +24,0 @@ ## Install |
Sorry, the diff of this file is not supported yet
16766
74