Socket
Socket
Sign inDemoInstall

node-graceful

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-graceful - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

index.js

@@ -54,2 +54,4 @@ // +----------------------------------------------------------------------+

Graceful.off = function (signal, listener) {
if (signal !== 'exit')
throw new Error('Only supports \'exit\' signal');
var index = Graceful.listeners.indexOf(listener);

@@ -56,0 +58,0 @@ if (index !== -1)

@@ -68,2 +68,4 @@ // +----------------------------------------------------------------------+

public static off(signal: 'exit', listener: GracefulListener) {
if (signal !== 'exit') throw new Error('Only supports \'exit\' signal');
const index = Graceful.listeners.indexOf(listener);

@@ -70,0 +72,0 @@ if (index !== -1) Graceful.listeners.splice(index, 1);

12

package.json
{
"name": "node-graceful",
"version": "3.0.0",
"version": "3.0.1",
"description": "Graceful process exit manager. allows waiting on multiple async services.",

@@ -32,3 +32,3 @@ "main": "index.js",

"build": "tsc --build tsconfig.json",
"prepublishOnly": "npm run test && npm run build"
"prepublishOnly": "npm run build && npm run test"
},

@@ -44,7 +44,7 @@ "files": [

"devDependencies": {
"@types/node": "8.10.48",
"ts-node": "^8.5.2",
"tslint": "^5.20.1",
"typescript": "^3.7.2"
"@types/node": "^12.12.30",
"ts-node": "^8.7.0",
"tslint": "^6.1.0",
"typescript": "^3.8.3"
}
}

@@ -19,2 +19,13 @@ # node-graceful

Typescript
```typescript
import Graceful from 'node-graceful';
Graceful.captureExceptions = true;
Graceful.on('exit', async () => {
await server.close();
});
```
Plain JS
```javascript

@@ -38,12 +49,2 @@ const Graceful = require('node-graceful');

Typescript
```typescript
import Graceful from 'node-graceful';
Graceful.captureExceptions = true;
Graceful.on('exit', async () => {
await server.close();
});
```
## Quick Docs

@@ -110,3 +111,3 @@

if old style callback is needed, wrap the logic with a promise
```
```javascript
const server = require('http').createServer(function (req, res) {

@@ -113,0 +114,0 @@ res.write('ok');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc