chad-fetch
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Chad Fetch MIT License Code Coverage

A tiny version of fetch for the browser (not a pollyfill)

Logo

Installation

  npm install chad-fetch

Usage

import fetch from 'chad-fetch'

// fetch.get(url, queryParams?) returns T
fetch
  .get<T>('https://rickandmortyapi.com/api/character', { page: 1 })
  .then(res => console.log(res))

// fetch.post(url, data) returns T | only uploads objects
fetch
  .post<T>('https://jsonplaceholder.typicode.com/posts', {
    title: 'foo',
    body: 'bar',
    userId: 1,
  })
  .then(res => console.log(res))

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.60latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i chad-fetch

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

23 kB

Total Files

24

Last publish

Collaborators

  • angeljohank