https://github.com/lifion/serv-term
Module for gracefully terminating Node.js HTTP servers
https://github.com/lifion/serv-term
Last synced: about 1 month ago
JSON representation
Module for gracefully terminating Node.js HTTP servers
- Host: GitHub
- URL: https://github.com/lifion/serv-term
- Owner: lifion
- License: mit
- Created: 2020-05-19T22:27:41.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-07T14:57:39.000Z (about 2 years ago)
- Last Synced: 2025-03-29T15:11:55.983Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.36 MB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# serv-term
[](http://badge.fury.io/js/serv-term)
## Getting Started
To install the module:
```sh
npm install serv-term --save
```## Features
## API Reference
### serv-term~createServerTerminator(server, options) ⇒
function
Registers connection listeners, and returns a function that when called will close a server and all open connections**Kind**: inner method of [
serv-term
](#module_serv-term)
**Returns**:function
- A function to initiate the shutdown of the server| Param | Type | Description |
| --- | --- | --- |
| server |http.Server
\|https.Server
| The server to be terminated |
| options |Object
| Accepts the following options |
| [options.timeout] |number
| The duration to wait before forcefully terminating the server |## License
[MIT](./LICENSE)