# elbywan/wretch

A tiny wrapper built around fetch with an intuitive syntax. :candy:

Repository: https://github.com/elbywan/wretch
Canonical: https://ross.abutalabs.com/products/wretch
Language: TypeScript
License: MIT
License Family: permissive
Topics: fetch, request, json, formdata, http-client, typescript, javascript, nodejs, http, ajax, http-request, promise
Last push: 2026-06-19T06:54:58+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 89, longevity 100
- inputs: {"age_days": 3276, "days_push": 75, "days_rel": 75, "gap_med": 16, "n_releases_24m": 14}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5178, forks 108 (observed 2026-08-28T04:09:11.765078+00:00)

## What it is
Wretch is a tiny (~1.8KB gzipped) TypeScript wrapper around the fetch API with an intuitive, chainable syntax for making HTTP requests. It handles error handling, headers, and (de)serialization, and is extensible via addons and middlewares.

## Use cases
- make http requests with a cleaner syntax than raw fetch
- handle json responses and errors from fetch calls
- send formdata or file uploads via http
- reuse and configure http request instances immutably
- add interceptors or middlewares to fetch requests
- use one http client across browser and node.js

## When to choose
- you want a lightweight fetch wrapper under 2KB
- you prefer chainable, promise-based request building
- you need isomorphic http requests in browsers, Node.js, Deno, or Bun
- you want built-in error handling and serialization with strong TypeScript types

## When to avoid
- you need advanced features like request cancellation, caching layers, or retries out of the box without addons
- you prefer a full-featured client like axios with interceptors and instance defaults built in
- you target environments without fetch support and no polyfill

## Facets
- artifact type: library
- maturity: active
- function: http-client, serialization, middleware
- domain: web-development, frontend, backend, apis, developer-tools
- platform: bun, browser, cross-platform
- tags: fetch-wrapper, ajax, promise-based, immutable-api, tiny-library, isomorphic, nodejs, deno, typescript, javascript

## Member repositories
- elbywan/wretch (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:11.765078+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:01:48.853278+00:00, confidence not recorded.
  - readme: https://github.com/elbywan/wretch (fetched 2026-08-28T04:09:11.765078+00:00, sha 01cd5e8368f0)
  - registry_npm: https://registry.npmjs.org/wretch (fetched 2026-08-29T08:55:52.799145+00:00, sha 4938d73b2549)
- Data as of 2026-08-30T08:39:29.467469+00:00.
