hyperfetch-ts
v0.2.0
Published
<div align="center"> <img src="https://github.com/TrialLord/HyperFetch/raw/main/hyper.png" alt="HyperFetch Logo" width="180" /> </div>
Readme
HyperFetch
A modern, high-performance, TypeScript-first HTTP client for Node, Browser, Bun, and more. Outperforms Axios.
Features
- 🚀 Faster than Axios (see benchmarks)
- 🧩 Middleware engine (logging, retry, timeout, caching, etc.)
- 🔄 Interceptors (request, response, error)
- 🔥 Streaming support (NDJSON, line-by-line)
- 🧪 90%+ test coverage
- 🪶 <5KB gzipped
- 🌍 Adapters for Node (undici), Fetch, Bun
- 🦾 TypeScript-native
- 🗂️ Pluggable, modular, ESM/CJS/UMD
Install
npm install hyperfetchUsage Example
import { HttpClient } from 'hyperfetch';
import { undiciAdapter } from 'hyperfetch/adapters/undiciAdapter';
const client = new HttpClient({
baseURL: 'https://jsonplaceholder.typicode.com',
adapter: undiciAdapter, // or fetchAdapter for browser
});
client.use(/* middleware, e.g. retry, cache, logging */);
const res = await client.get('/todos/1');
console.log(res.data);Benchmarks
| Scenario | HyperFetch | Axios | Fetch | |----------------------------------|------------|-------|-------| | Sequential GET (100 req) | 2087ms | 2010ms| 2596ms| | Concurrent GET (100 req, 10x) | 325ms | 370ms | 366ms | | Concurrent POST (100 req, 10x) | 1079ms | 1054ms| 558ms |
Documentation
License
MIT
