Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

server-destroy

isaacs5.1mISC1.0.1TypeScript support: definitely-typed

Enable destroying a server, and all currently open connections.

readme

server-destroy

Enable destroying a server, and all currently open connections.

Usage

var enableDestroy = require('server-destroy');

var server = http.createServer(function(req, res) {
  // do stuff, blah blah blah
});

server.listen(PORT);

// enhance with a 'destroy' function
enableDestroy(server);

// some time later...
server.destroy();