This package has been deprecated

Author message:

All @vatr/* packages rename to @alwatr/*, please rename all your dependencies.

@vatr/fetch
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@vatr/fetch

Enhanced fetch API with the timeout, helper methods, and types written in tiny TypeScript, ES module.

Options

Options inherited from the RequestInit. you can watch all documents of the parameters RequestInit in fetch init parameters

Options have two other parameters:

  • bodyObject: a JSON object that converts to string and put on the body.
  • queryParameters: a JSON object that converts to URL query params

Example usage

import {getJson} from 'https://esm.run/@vatr/fetch';

const productList = await getJson('/api/products', {limit: 10}, {timeout: 5_000});

Package Sidebar

Install

npm i @vatr/fetch

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

13.3 kB

Total Files

8

Last publish

Collaborators

  • alimd