@zero-dependency/fetcher
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

@zero-dependency/fetcher

npm version npm bundle size (scoped) npm license

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, ... }

Package Sidebar

Install

npm i @zero-dependency/fetcher

Weekly Downloads

10

Version

1.2.5

License

MIT

Unpacked Size

22.3 kB

Total Files

14

Last publish

Collaborators

  • crashmax