New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

safe-http-close

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-http-close

Close an http server even if it isn't running

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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'); }
});

Keywords

http

FAQs

Package last updated on 12 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts