🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

close-server

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

close-server

Promisified net.Server.close()

0.0.3
latest
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created

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

FAQs

Package last updated on 18 May 2020

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