timelimit
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

timelimit

NPM version Downloads Dependency status Dev Dependency status

Reject promises on timeout.

Installation

npm install --save timelimit

Usage

Basic usage:

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)
  },
)

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i timelimit

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    6.61 kB

    Total Files

    10

    Last publish

    Collaborators

    • inker