# express-graceful-shutdown

> Ensure that during shutdown express returns correctly with a 503

Latest version **1.1.3** (published 2019-09-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install express-graceful-shutdown
pnpm add express-graceful-shutdown
yarn add express-graceful-shutdown
bun add express-graceful-shutdown
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-09-29 |
| First published | 2014-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=9.7.0 |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Paul Serby |
| Maintainers | serby |

## Links

- npm: https://www.npmjs.com/package/express-graceful-shutdown
- Repository: git@github.com:serby/express-graceful-shutdown
- npm.io page: https://npm.io/package/express-graceful-shutdown

## Recent versions

- 1.1.3 (latest) — 2019-09-29
- 1.1.2 — 2019-09-29
- 1.1.1 — 2019-09-29
- 1.0.0 — 2018-08-10
- 0.0.3 — 2016-05-19
- 0.0.2 — 2014-11-12
- 0.0.1 — 2014-07-01

## README

# express-graceful-shutdown

Ensure that during shutdown express returns correctly with a 503

[![build status](https://secure.travis-ci.org/serby/express-graceful-shutdown.png)](http://travis-ci.org/serby/express-graceful-shutdown)

## Installation

```
npm install express-graceful-shutdown --save
```

## Options

- `logger`: a logger that provides `info`, `warn`, and `error` functions for recording graceful shutdown. Default: `console`.
- `forceTimeout`: number of milliseconds to wait for `server.close()` to complete before calling `process.exit(1)`. Default: `30000`.

## Usage

```js
var express = require('express'),
  app = express(),
  createGracefulShutdownMiddleware = require('express-graceful-shutdown'),
  http = require('http'),
  server = http.createServer(app)

app.use(createGracefulShutdownMiddleware(server, { forceTimeout: 30000 }))

app.get('/', function(req, res) {
  res.json({ foo: 'bar' })
})

server.listen(3000)
```

## Prettier

This project uses prettier for code formatting and linting. You can set prettier
up to [auto format code in your editor](https://prettier.io/docs/en/editors.html),
or manually format code before committing with `yarn prettier`.

## Credits

[Paul Serby](https://github.com/serby/) follow me on twitter [@serby](http://twitter.com/serby)

## License

Licensed under the [ISC](https://opensource.org/licenses/ISC)

---
_Source: https://npm.io/package/express-graceful-shutdown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
