npm package — v1.0.0

The HTTP client fetch should have been.

A modern HTTP client for Node.js and edge runtimes. Zero dependencies. Full TypeScript support.

$ npm install @firekid/hurl
View on GitHub
GitHub Stars
GitHub Forks
npm Downloads
MIT
License

Features

Zero dependencies, full TypeScript

01
Zero Dependencies
No bloat. No supply chain risk. Pure fetch under the hood, nothing else.
02
Smart Retries
Fixed, linear, or exponential backoff with configurable status codes and delay.
03
Auth Built-in
Bearer, Basic, and API key auth — set per request or globally via defaults.
04
Response Caching
In-memory TTL cache for GET requests. Bypass or skip the cache anytime.
05
Interceptors
Hook into request, response, and error lifecycles. Fully async-friendly.
06
Progress Tracking
Upload and download callbacks with loaded, total, and percent values.
07
Edge Ready
Runs on Cloudflare Workers, Vercel Edge, Deno, Bun, and Node 18+.
08
Full TypeScript
Typed generics on every method. IntelliSense everywhere you need it.
09
Request Dedup
Concurrent calls to the same URL collapse into a single network request.


The switch

Why developers are replacing axios

axios / request
Heavy — 400KB+ bundle impact
request is officially deprecated
Not built for edge runtimes
CommonJS-first, ESM bolted on
No built-in deduplication
hurl
Zero dependencies, fetch-native
Actively maintained, MIT
Runs on Workers, Edge, Deno, Bun
ESM + CJS, TypeScript first
Built-in request deduplication

Infrastructure

Built for edge runtimes

Cloudflare Workers
Full compatibility. No polyfills needed. Runs at the edge globally.
Vercel Edge Functions
Deploy on Vercel's edge network with zero config changes.
Node.js 18+
Native fetch support means hurl works out of the box.
Deno & Bun
Modern runtimes supported. ESM and CJS exports included.

Methods & Environments

Everything you need, nothing you don't

HTTP Methods

hurl.get Fetch a resource, cache-eligible
hurl.post Create — body auto-serialized to JSON
hurl.put Full resource replacement
hurl.patch Partial update
hurl.delete Remove a resource
hurl.head Headers only, no body
hurl.all Parallel requests, array input

Environments

Node.js 18+ Cloudflare Workers Vercel Edge Deno Bun

Module Formats

ESM CommonJS TypeScript

Quick Start

typescript
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'),
])

Find us