Skip to content

This package provides some useful utilities and functions for using the Fetch API.

License

Notifications You must be signed in to change notification settings

magiclen/ts-fetch-helper

Repository files navigation

Fetch Helper

CI

This package provides some useful utilities and functions for using the Fetch API.

Usage

import { timeoutFetch } from "fetch-helper-x";

const response = await timeoutFetch("https://google.com", { requestTimeout: 10000, idleTimeout: 1000 });

console.log(await response.text());
// if you want to cancel the body, use `await response.cancelBody()` instead; otherwise, the program will hang because the connection and timer are still active

Usage for Browsers

Source

Demo Page

License

MIT

About

This package provides some useful utilities and functions for using the Fetch API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published