close-server
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

close-server

Promisified net.Server.close()

Usage

Install it:

npm install close-server
yarn add close-server

Pass a net.Server (such as http.Server) to close-server and it will return a Promise which closes the server.

import http from 'http';
import closeServer from 'close-server';

const srv = http.createServer();
srv.listen()
...

await closeServer(srv)

Authors

Readme

Keywords

none

Package Sidebar

Install

npm i close-server

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

2 kB

Total Files

7

Last publish

Collaborators

  • maxchehab