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

Dependents (0)

Package Sidebar

Install

npm i chad-fetch

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

23 kB

Total Files

24

Last publish

Collaborators

  • angeljohank