fetch-timer

1.1.0 • Public • Published

Fetch with Timeout

This is s simple wrapper for the regular fetch function that allows it to use timeout in miliseconds.

You may use any parameter that you will normally use with the regular fetch

Installation


npm install fetch-timer

Usage


const Fetch = require('fetch-timer');

Fetch('https://jsonplaceholder.typicode.com/posts', { timeout: 100 })
    .then(res => res.json())
    .then(res => console.log(res))	
    .catch((e)=> console.log(e))

Readme

Keywords

Package Sidebar

Install

npm i fetch-timer

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

1.33 kB

Total Files

3

Last publish

Collaborators

  • steinhakasevs