# timeout-signal

> Create an AbortSignal that aborts after a delay

Latest version **2.0.0** (published 2022-11-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-11-12 |
| First published | 2020-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Richie Bendall |
| Maintainers | richienb |
| Keywords | timeout, signal, abort |

## Links

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

## Recent versions

- 2.0.0 (latest) — 2022-11-12
- 1.1.0 — 2020-08-26
- 1.0.0 — 2020-05-24

## README

# timeout-signal

> Create an AbortSignal that aborts after a delay

## Install

```sh
npm install timeout-signal
```

## Usage

```js
import timeoutSignal from 'timeout-signal';

try {
	const response = await fetch('https://www.google.com', {signal: timeoutSignal(5000)});
	// Handle response
} catch (error) {
	if (signal.aborted) {
		// Handle abortion
	}
}
```

## API

### timeoutSignal(timeout)

#### timeout

Type: `integer`

The milliseconds to wait.

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