A favicon of Wretch

Wretch

Make fetch requests easily with an intuitive, tiny, immutable, and type-safe wrapper. Simplifies error handling, headers, and serialization.

Visit Wretch

Wretch is a tiny (~2KB gzipped) wrapper built around the native fetch API, designed to provide a more intuitive syntax for making HTTP requests. It simplifies common tasks like handling response bodies, managing headers, and processing request errors, reducing boilerplate code compared to using fetch directly.

Key features include:

  • Immutability: Every configuration change creates a new, cloned instance, allowing safe reuse of base configurations.
  • Simplified Error Handling: Provides built-in catchers for common HTTP error codes (like 404, 401, 418) and a general error handler.
  • Easy Data Handling: Offers shorthands for sending JSON data and parsing response bodies (.json(), .text(), .blob(), etc.) without the extra .then() step.
  • Modularity: Extend functionality with addons (like query string handling, form data, abort controller) and middlewares (like retry, dedupe, caching).
  • Isomorphic: Works consistently in modern browsers, Node.js (v14+), and Deno.
  • Type Safe: Written entirely in TypeScript, offering strong typing for better developer experience.
Share:
Featured tools:

Similar to Wretch:

Flexible JavaScript ORM for Node.js database interactions.
JavaScript & TypeScriptORMs
Build Node.js applications with a flexible JavaScript ORM. Features promise/callback interfaces, transactions, eager loading, and relations for PostgreSQL, MySQL, SQLite3.
Markdown to docs site, no build needed.
DocumentationJavaScript & TypeScript
Generate documentation sites dynamically from Markdown files. Creates lightweight, single-page application sites without requiring a static build step.
Build optimized websites quickly, focus on your content.
DocumentationJavaScript & TypeScript
Quickly build optimized websites like docs, blogs, or landing pages using React. Write content easily with MDX support and leverage built-in versioning and search.
Minimalist, flexible web framework for Node.js.
Full-stack Web FrameworksJavaScript & TypeScript
Build fast web applications and APIs with this minimal, flexible Node.js framework. Offers robust features and a large middleware ecosystem for extensibility.
Tiny & elegant Fetch API wrapper for JS
HTTP for JSJavaScript & TypeScript
Make HTTP requests easily with this tiny, elegant client built on the Fetch API. Offers a simpler API, retries, timeouts, hooks, and improved JSON handling.
TypeScript ORM for Node.js: Data Mapper, UoW, SQL & NoSQL.
JavaScript & TypeScriptORMs
Build Node.js apps with a TypeScript ORM using Data Mapper and Unit of Work patterns. Supports SQL/NoSQL, offers schema tools, and automatic query batching.
Type-safe ORM for Node.js, TypeScript & Browser.
JavaScript & TypeScriptORMs
Query SQL databases in Node/TS with strong typing. Features Active Record style, no code gen, powerful filters, and secure browser access via Express plugin.
Next-gen ORM for simplified, type-safe database access.
JavaScript & TypeScriptORMs
Interact with databases using a type-safe ORM for Node.js/TypeScript. Features automated migrations, intuitive schema, connection pooling, and caching.
Modern ORM for TypeScript & Node.js SQL databases.
JavaScript & TypeScriptORMs
Manage database interactions in Node.js/TypeScript apps. Supports transactions, relations, eager/lazy loading, and multiple SQL databases like Postgres & MySQL.

Command Menu