# timelimit

> Reject promises on timeout

Latest version **1.0.1** (published 2018-08-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install timelimit
pnpm add timelimit
yarn add timelimit
bun add timelimit
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-08-06 |
| First published | 2018-01-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anton Veselyev |
| Maintainers | inker |
| Keywords | timelimit, timeout, Promise, async, await |

## Links

- npm: https://www.npmjs.com/package/timelimit
- Repository: https://github.com/inker/timelimit
- Homepage: https://github.com/inker/timelimit#readme
- Issues: https://github.com/inker/timelimit/issues
- npm.io page: https://npm.io/package/timelimit

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-08-06
- 1.0.0 — 2018-01-13

## README

# timelimit

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]

Reject promises on timeout.

## Installation
```
npm install --save timelimit
```

## Usage
Basic usage:
```javascript
import timelimit from 'timelimit'

const req = timelimit(
  fetch('https://example.com'),
  10000, // 10 seconds
  {
    rejectOnTimeout: true, // default is true
    errorMessage: 'timeout', // timeout error message (thrown if rejectOnTimeout is true)
  },
)
```

[npm-url]: https://npmjs.org/package/timelimit
[downloads-image]: http://img.shields.io/npm/dm/timelimit.svg
[npm-image]: http://img.shields.io/npm/v/timelimit.svg
[david-dm-url]:https://david-dm.org/inker/timelimit
[david-dm-image]:https://david-dm.org/inker/timelimit.svg
[david-dm-dev-url]:https://david-dm.org/inker/timelimit#info=devDependencies
[david-dm-dev-image]:https://david-dm.org/inker/timelimit/dev-status.svg

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