A tiny fetch wrapper with an intuitive syntax

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

Wretch 3.0 gives JavaScript developers a tiny (<1.8KB gzipped), TypeScript-typed fetch wrapper with chainable error handling, removing repetitive HTTP boilerplate.

Read this as

Wretch is a free, open-source helper library for JavaScript that makes sending web requests easier. Normally, fetching data from a server means writing the same repetitive code, checking for errors, converting responses, over and over. Wretch lets developers write those steps as a short, readable chain instead. It works in browsers and in server runtimes like Node.js, Deno and Bun.

Wretch 3.0 is a free, MIT-style community library competing with native fetch and similar wrappers like ky. Its cost is negligible, under 1.8KB gzipped, and it has years of maintenance plus full unit-test coverage, limiting adoption risk. The downside is dependency on a small project rather than a vendor. Teams building API-heavy front-ends gain the most.

Wretch 3.0 wraps the Fetch API with a chainable, immutable API where every call clones the instance, enabling safe shared base clients. Core is under 1.8KB gzipped, written in TypeScript, and isomorphic across modern browsers, Node.js 22+, Deno and Bun. It handles serialization, response typing (.json(), .text(), .res(), .blob()), and chainable per-status error handlers like .notFound(). Addons and middlewares extend it; a v2-to-v3 migration guide exists.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Wretch Fetch API Node.js Deno Bun GitHub

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading