@zero-dependency/fetcher
v1.2.5
Published
Fetch wrapper
Downloads
34
Maintainers
Readme
@zero-dependency/fetcher
Installation
npm install @zero-dependency/fetcher
yarn add @zero-dependency/fetcher
pnpm add @zero-dependency/fetcher
Usage
import { Fetcher, fetcher } from '@zero-dependency/fetcher'
interface Post {
id: number
userId: number
title: string
body: string
}
const api = new Fetcher('https://jsonplaceholder.typicode.com')
const post = await api.get<Post>('/posts/1')
console.log(post) // { id: 1, postId: 1, ... }