safe-http-close

1.0.1 • Public • Published

safe-http-close

httpServer.close will (throw in node < 0.12) callback with an error if the server is still running. This is not what you want if you're just cleaning up connections as part of your server's shutdown procedure. This libary provides a function for you to safely close your server

Installation

npm install safe-http-close

Usage

Instead of calling httpServer.close, do

var safeClose = require('safe-http-close');
 
safeClose(server, function (err) {
  if (!err) { console.log('closed'); }
});

Dependencies (1)

Dev Dependencies (4)

Package Sidebar

Install

npm i safe-http-close

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • rahulbharadwaj
  • jasif-wm
  • shyam.mohan
  • qbibrahim
  • sidharth.n
  • hariqb
  • arjuncprasannan
  • renjith_ram_qburst
  • anasqburst
  • jyothis-qb
  • qburst-pratyush
  • cdrohithmqb
  • sudheeshqburst
  • davoodul
  • mable-liza-mathew
  • sowmyab
  • anoop-kuttikkattu
  • munisa
  • dheerajds
  • arjunqb
  • ashishqburst
  • lanetix-system
  • manu-kodiyan-winmore
  • dnm-winmore
  • mkdyanugk
  • vigneshk7
  • soumyaarun
  • aswanth
  • sajith.qb
  • dhiluraj-qburst
  • anandqb
  • arun-dtk
  • vikasqb
  • acpradosh1234