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

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

Awesome Lists containing this project

README

        

# serv-term

[![npm version](https://badge.fury.io/js/serv-term.svg)](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)