Skip to content

FoundatioFx/FetchClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundatio Foundatio

NPM JSR Build status Discord

FetchClient is a tiny, typed wrapper around fetch with JSON helpers, caching, middleware, rate limiting, timeouts, and friendly error handling.

Install

npm install @foundatiofx/fetchclient

Quick Example

import { FetchClient } from "@foundatiofx/fetchclient";

type Products = { products: Array<{ id: number; name: string }> };

const client = new FetchClient();
const { data } = await client.getJSON<Products>(
  `https://dummyjson.com/products/search?q=iphone&limit=10`,
);

console.log(data?.products.length);

Documentation


MIT © Foundatio

About

A typed JSON fetch client with middleware support for Deno, Node and the browser

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •