fetchtastic@0.3.3
Small wrapper around fetch designed to perform more predictable and type-safe network requests.
Repository
Current version released
2 years ago
🌩️ Fetchtastic
Small wrapper around fetch designed to perform more predictable and type-safe network requests.
📖 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 fetchtasticpnpm
pnpm add fetchtasticyarn
yarn add fetchtasticdeno
import { Fetchtastic } from 'https://deno.land/x/fetchtastic/lib/mod.ts';