# if-timeout

> Timeout middleware

Latest version **1.0.1** (published 2016-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install if-timeout
pnpm add if-timeout
yarn add if-timeout
bun add if-timeout
```

## 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.0.1 |
| Published | 2016-09-19 |
| First published | 2016-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | SebastianOsuna |
| Maintainers | jsebastianosuna |
| Keywords | timeout, middleware |

## Links

- npm: https://www.npmjs.com/package/if-timeout
- Repository: https://github.com/SebastianOsuna/if-timeout
- Homepage: https://github.com/SebastianOsuna/if-timeout#readme
- Issues: https://github.com/SebastianOsuna/if-timeout/issues
- npm.io page: https://npm.io/package/if-timeout

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-09-19
- 1.0.0 — 2016-09-13

## README

ifTimeout
===

# Usage

```javascript
var ifTimeout = require('if-timeout');
app.use(ifTimeout(sendMeAnEmail, { timeout: 20000, ignore: [/long\/running\/service/i] }));

function sendMeAnEmail (req, res, next) {
  var params = JSON.stringify(req.body || {});
  sendEmail('to@me.com', params);
}
```

# Docs

`ifTimeout(fn, [opts])`

- `opts.timeout` *(defaults: 30000)* Wait time in milliseconds.
- `opts.ignore` *(defaults: [])* List of regex to ignore (compared with the request path).

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