close-server
v0.0.3
Published
Promisified net.Server.close()
Downloads
2
Readme
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)