graceful-exit

0.0.1 • Public • Published

graceful-exit Build Status

Gracefully exit your node process (e.g., wait for network connections to close).

Installation

npm install graceful-exit

Usage

var http = require('http'),
    gracefulExit = require('graceful-exit')();
 
http.createServer(function (req, res) {
  gracefulExit();
  setTimeout(function () {
    res.end();
    // Process will exit now.
  }, 1000);
}).listen(8000, function () {
  http.get({
    host: 'localhost',
    port: 8000
  });
});

Readme

Keywords

none

Package Sidebar

Install

npm i graceful-exit

Weekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • mmalecki