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()
- Host: GitHub
- URL: https://github.com/maxchehab/close-server
- Owner: maxchehab
- Created: 2020-01-23T04:03:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:33:03.000Z (over 2 years ago)
- Last Synced: 2025-03-01T19:20:27.849Z (2 months ago)
- Language: HTML
- Homepage: https://npmjs.com/close-server
- Size: 807 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
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)