An open API service indexing awesome lists of open source software.

https://github.com/maxchehab/close-server

🔌 Promisified net.Server.close()
https://github.com/maxchehab/close-server

Last synced: about 1 month ago
JSON representation

🔌 Promisified net.Server.close()

Awesome Lists containing this project

README

        

# close-server

Promisified `net.Server.close()`

## Usage

Install it:

```bash
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.

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

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

await closeServer(srv)
```

## Authors

- [Max Chehab](https://github.com/maxchehab)