npm package — v1.0.0
A modern HTTP client for Node.js and edge runtimes. Zero dependencies. Full TypeScript support.
Features
The switch
Infrastructure
Methods & Environments
Quick Start
import hurl, { HurlError } from '@firekid/hurl' const res = await hurl.get<User[]>('https://api.example.com/users') res.data res.status res.timing res.fromCache const data = await hurl.get('/protected', { auth: { type: 'bearer', token: 'my-token' }, retry: { count: 3, backoff: 'exponential' }, cache: { ttl: 60000 }, }) try { await hurl.post('/users', { name: 'John' }) } catch (err) { if (err instanceof HurlError) { console.log(err.type, err.status, err.retries) } } const [users, posts] = await hurl.all([ hurl.get('/users'), hurl.get('/posts'), ])