Skip to content

victorstein/fetch-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple wrapper function to add timeout functionality to the regular node-fetch library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published