Jext / http v0.0.1

An HTTP client that never throws and weighs 3.7 KB

The response comes already parsed by Content-Type, and every outcome is { data, error }. The core reads JSON and text and has timeouts; retries, a cache, SSE, NDJSON, progress and 14 more are plugins that get into your bundle only when you import them.

Coming to npm soon. Meanwhile, the code is on GitHub.
app.ts
import { http } from '@metapraxis/jext-http';

const { data: user, error } = await http
	.send<User>('/api/users/1');

if (error) {
	// 404, a dropped connection, a timeout:
	// one if, no try/catch
	console.log(error.status, error.data);
} else {
	console.log(user.name);
}

Smaller and faster

Size

3.7KB min + gzip, of a 4 KB budget

11.13KB with all 19 plugins, of 12 KB: about ky alone and half of axios

  • redaxios 0.5.1 no retries, timeouts or hooks 0.92
  • ofetch 2.0.0-alpha.3 2.33
  • jext-http the core: JSON, text, timeouts 3.70
  • ofetch 1.5.1 3.95
  • ky 2.2.0 10.69
  • jext-http + all with every plugin 11.13
  • axios 1.22.0 22.04

Measured 3 December 2026 · Source

Speed

≈3×faster than ky on a plain GET

≈5×faster than axios on a plain GET

17×faster than axios on a 404: an error is a value, not a throw

Details: the full table
Scenario, µsfetchjextofetchkyaxios
GET, a small JSON object 5.70 7.22 7.04 21.16 40.83
GET, a JSON array of 5000 objects (412 KB) 2071 2195 2703 2751 2828
POST, a JSON body, the created object back 13.79 15.65 16.14 48.72 76.29
A client: base URL, Authorization, a beforeRequest hook 8.84 11.34 11.68 32.37 54.08
GET, a 404 with a JSON body 5.79 10.07 16.96 42.28 170.38

The median time of one request in microseconds, the middle of three runs, lower is better. fetch answers from memory, so the table shows the work of each client, not the network. The numbers move by about 5%, so a smaller difference is a tie.

Measured 2 December 2026, Node 24 · Source

What others lack

send() never throws

Every outcome is { data, error }: a 404, a dropped connection and a timeout are one if, no try/catch.

ky, ofetch and axios throw on a 4xx or 5xx status by default

A cache with ETag and background refresh

GET responses stay in memory, refresh in the background and are dropped after a POST to their path.

ky, ofetch and axios do not have it

Upload progress

The percent of a file sent to the server, in every browser.

fetch, ky and ofetch report no upload progress

Server-Sent Events as a POST with a token

A model or chat stream with an Authorization header and reconnects.

the browser EventSource cannot do it

Plugins: take only what you need

Each plugin is its own import. A bundler keeps only the ones your app uses, so you pay for what you use.

  • retry repeats a 503, a 429 or a dropped connection with backoff and Retry-After +0.69 KB
  • cache GET responses in memory, revalidated with ETag, dropped after a POST +1.39 KB
  • sse Server-Sent Events, also as a POST with a token +1.55 KB
  • ndjson NDJSON lines while they arrive +0.86 KB
  • progress upload and download progress +1.05 KB
  • schema data checked by any Standard Schema: Zod, Valibot, ArkType +0.31 KB
  • auth a token on every request, one refresh for all 401s +0.32 KB
  • queue no more than N requests at once and a rate limit +1.01 KB
  • dedupe identical requests at the same moment share one +0.67 KB
  • hooks steps before and after every request +0.33 KB
  • paginate for await over pages: Link header or a cursor +0.23 KB
  • csv CSV and TSV as rows +0.27 KB
  • xml XML as an object (through fast-xml-parser) +0.14 KB
  • html HTML as a Document +0.07 KB
  • form FormData and URLSearchParams +0.09 KB
  • binary files as Blob and ArrayBuffer +0.15 KB
  • mock answers from routes instead of the network, for tests +0.47 KB
  • same-origin the token never leaves your origin +0.18 KB
  • decoder a format of your own: YAML, TOML and others +0.14 KB

793test files: unit, integration, feature, browser, size and speed

47lessons: each task next to fetch, XMLHttpRequest, axios, ky and ofetch

MITlicence, zero required dependencies