Skip to main content
Deno 2 is finally here 🎉️
Learn more

🌩️ Fetchtastic

Small wrapper around fetch designed to perform more predictable and type-safe network requests.

MIT GitHub issues GitHub commit activity npm npm

📖 Documentation.

Features
🪶 Lightweight Less than 3KB gzipped
🧩 Composable Safely reuse previous configurations
Intuitive Clean and easy to use API
🛡️ Type safe Strongly typed, written in TypeScript
🛠️ Isomorphic Compatible with modern browsers, Node.js and Deno
Well Tested Covered by unit tests
const api = new Fetchtastic('https://jsonplaceholder.typicode.com')
  .setOptions({ cache: 'default', mode: 'cors' })
  .headers({
    Accept: 'application/json',
    'Content-Type': 'application/json',
  });

const blogData = await api
  .searchParams({ page: 1, per_page: 12 })
  .get('/posts')
  .json(PostSchema.parse);

await api.post('/albums', { title: 'My New Album' }).resolve();

npm

npm install fetchtastic

pnpm

pnpm add fetchtastic

yarn

yarn add fetchtastic

deno

import { Fetchtastic } from 'https://deno.land/x/fetchtastic/lib/mod.ts';