Skip to content

Useful utilities for working with Fetch

License

Notifications You must be signed in to change notification settings

sindresorhus/fetch-extras

Repository files navigation

fetch-extras logo

Useful utilities for working with Fetch

Warning

This package is still a work in progress.

For more features and conveniences on top of Fetch, check out my ky package.

Install

npm install fetch-extras

Usage

import {throwIfHttpError} from 'fetch-extras';

const response = await throwIfHttpError(fetch('/api'));

API

See the types for now.

Related

  • is-network-error - Check if a value is a Fetch network error
  • ky - HTTP client based on Fetch