@allegiant/shutdown
Advanced tools
Comparing version 0.2.1 to 0.2.3
@@ -11,2 +11,3 @@ /* | ||
process.removeListener('uncaughtException', uncaughtExceptionHandler); | ||
process.removeListener('unhandledRejection', unhandledPromiseRejectionHandler); | ||
process.emit('finished'); | ||
@@ -35,2 +36,6 @@ process.exit(); | ||
function unhandledPromiseRejectionHandler(e, p) { | ||
console.log('Unhandled Rejection at: Promise', p, 'Reason:', e, e.stack); // eslint-disable-line | ||
} | ||
function install(callback) { | ||
@@ -47,2 +52,3 @@ if (typeof callback !== 'function') | ||
process.on('uncaughtException', uncaughtExceptionHandler); | ||
process.on('unhandledRejection', unhandledPromiseRejectionHandler); | ||
process.shutdown = function(err=false) { | ||
@@ -58,3 +64,3 @@ shutdown(err); | ||
if (process.platform.slice(0,3) == 'win') { | ||
var read = require('readline').createInterface({ | ||
require('readline').createInterface({ | ||
input: process.stdin, | ||
@@ -61,0 +67,0 @@ output: process.stdout |
{ | ||
"name": "@allegiant/shutdown", | ||
"version": "0.2.1", | ||
"version": "0.2.3", | ||
"description": "Simple graceful shutdown helper library.", | ||
@@ -21,11 +21,12 @@ "author": "echopoint <echopoint@tutanota.com>", | ||
"scripts": { | ||
"lint": "eslint index.js", | ||
"test": "tape test/*.js", | ||
"coverage": "tape test/*.js --coverage --coverage-report=lcov" | ||
"lint": "eslint .", | ||
"test": "tap test/*.js", | ||
"coverage": "tap test/*.js --coverage" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"eslint": "^4.12.1", | ||
"jsdoc": "^3.5.5", | ||
"tape": "^4.8.0" | ||
"tap": "^11.0.1" | ||
} | ||
} |
@@ -6,2 +6,14 @@ # shutdown | ||
[![Npm Version](https://img.shields.io/npm/v/@allegiant/shutdown.svg)](https://www.npmjs.com/package/@allegiant/shutdown) | ||
[![Build Status](https://travis-ci.org/allegiant-js/shutdown.svg?branch=master)](https://travis-ci.org/allegiant-js/shutdown.svg?branch=master) | ||
[![Coverage Status](https://coveralls.io/repos/github/allegiant-js/shutdown/badge.svg?branch=master)](https://coveralls.io/github/allegiant-js/shutdown?branch=master) | ||
## Installation | ||
``` | ||
npm install @allegiant/shutdown --save | ||
``` | ||
## Usage | ||
```js | ||
@@ -34,2 +46,2 @@ const Shutdown = require('@allegiant/shutdown'); | ||
Availble via [npm](https://www.npmjs.com/package/@allegiant/shutdown) or [github](https://github.com/allegiant-js/shutdown). | ||
Availble via [npm](https://www.npmjs.com/package/@allegiant/shutdown) or [github](https://github.com/allegiant-js/shutdown). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6887
8
76
46