awesome-repositories.com
Blog
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoAcerca deCómo clasificamosPrensaServidor MCP
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
unjs avatar

unjs/ofetch

0
View on GitHub↗
5,316 estrellas·170 forks·TypeScript·MIT·9 vistas

Ofetch

ofetch is an HTTP client built on the native fetch API that adds automatic JSON serialization, request/response interceptors, configurable retry, and timeout handling. It provides descriptive error objects for non-OK responses and automatically parses response bodies based on their content type.

The client supports creating pre-configured instances with preset base URLs, headers, and default options, enabling consistent configuration across a project. It offers full TypeScript type inference for response data and request payloads, and allows extending request options with custom properties while preserving type safety. Additional capabilities include hooking into the request lifecycle via async interceptors, routing requests through proxy servers using standard environment variables, and consuming Server-Sent Events streams in real time.

The library also provides flexible error handling with parsed response bodies, the ability to access raw Response objects, and support for request body serialization including binary data. ofetch is available as a TypeScript package and can be installed via common JavaScript package managers.

Features

  • Fetch API Wrappers - Wraps the native fetch API with additional features like interceptors, retry, and timeout.
  • JSON Request Serializers - Automatically stringifies object request bodies as JSON and sets the appropriate Content-Type header.
  • Automatic Body Deserializers - Automatically converts response data into JSON or Blob based on Content-Type header.
  • Response Body Parsing - Automatically parses HTTP response bodies as JSON, text, or binary based on content type.
  • HTTP Request Abstractions - Provides a feature-rich fetch wrapper that adds retries, timeouts, and automatic error handling.
  • HTTP Request Customization - Merges custom base URL, query parameters, headers, and timeout into every request.
  • Fetch-Based HTTP Clients - Ships a full-featured HTTP client built on the native fetch API with automatic JSON parsing, interceptors, retry, and timeout handling.
  • Client Instance Defaults - Creates reusable HTTP client instances with preset base URL, headers, and default options.
  • Retry Policies - Provides configurable retry of failed requests with custom status codes and delay between attempts.
  • API Request Configurations - Configures base URLs, default headers, and query parameters that apply to every request.
  • Pre-Configured HTTP Clients - Offers a factory function to create reusable HTTP clients with preset base URLs, headers, and default options.
  • API Request Configurations - Configures base URL, query parameters, and custom headers that apply to each request.
  • Descriptive HTTP Error Responses - Throws descriptive errors that include the parsed response body for non-OK HTTP responses.
  • HTTP Error Handling - Throws descriptive errors with parsed response body for non-OK statuses.
  • Descriptive HTTP Error Responses - Provides descriptive error objects containing the parsed response body for failed HTTP requests.
  • HTTP Request Interceptors - Provides async interceptors that hook into the request and response lifecycle for modification and logging.
  • Content-Type Based Deserializers - Automatically parses response bodies as JSON, blob, or text based on the Content-Type header.
  • Request Body Attachers - Automatically stringifies JSON request bodies and sets Content-Type headers, with binary support.
  • Request Lifecycle Hooks - Provides async hooks for logging, authentication, and dynamic modification during request lifecycle.
  • Request-Response Interceptors - Enables global interceptors to modify or log outgoing requests and incoming responses.
  • Request Retries - Automatically retries failed HTTP requests with configurable status codes, count, and delay.
  • Server Error Retries - Retries requests automatically on server error status codes with configurable delay and count.
  • Type-Safe Option Extensions - Adds custom properties to request configuration objects while preserving full type safety.
  • Request Abort Signals - Supports request timeout and custom cancellation signals to abort ongoing requests.
  • Response Type Inference - Infers response data types automatically so editors provide autocomplete for fields.
  • Request Timeouts - Aborts requests that exceed a specified time limit to prevent hanging connections.
  • Type-Safe API Clients - Provides full TypeScript type inference for response data and request payloads, ensuring type-safe client-server communication.

Historial de estrellas

Gráfico del historial de estrellas de unjs/ofetchGráfico del historial de estrellas de unjs/ofetch

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Alternativas open-source a Ofetch

Proyectos open-source similares, clasificados según cuántas características comparten con Ofetch.
  • sindresorhus/kyAvatar de sindresorhus

    sindresorhus/ky

    16,943Ver en GitHub↗

    🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API

    TypeScriptfetchhttp-clienthttp-request
    Ver en GitHub↗16,943
  • elbywan/wretchAvatar de elbywan

    elbywan/wretch

    5,174Ver en GitHub↗

    Wretch is a chainable HTTP client library and Fetch API wrapper designed to simplify network request configuration, response parsing, and error handling. It functions as a network request manager and middleware framework for managing the end-to-end lifecycle of HTTP calls. The project is distinguished by a fluent interface for request configuration and a modular extension system. It utilizes a programmable response resolver to automate parsing and a plugin-based architecture to add new capabilities to request and response objects. The library covers a broad range of operational capabilities,

    TypeScript
    Ver en GitHub↗5,174
  • forwardemail/superagentAvatar de forwardemail

    forwardemail/superagent

    16,649Ver en GitHub↗

    Superagent is an isomorphic JavaScript HTTP client for sending network requests and processing responses across both Node.js and web browser environments. It provides a fluent request builder that uses a chainable interface to construct complex network requests with custom headers, query strings, and bodies. The library functions as a runtime-agnostic request adapter, allowing a single codebase to work consistently across different environments. It includes specialized capabilities such as an HTTP/2 client for forcing the HTTP/2 protocol and a Node.js agent for managing Unix socket connection

    JavaScript
    Ver en GitHub↗16,649
  • mzabriskie/axiosAvatar de mzabriskie

    mzabriskie/axios

    109,096Ver en GitHub↗

    Axios is a promise-based HTTP client used to make asynchronous network requests in both browser and Node.js environments. It functions as a multi-environment network adapter that abstracts the transport layer to ensure consistent behavior across different runtimes. The project distinguishes itself through a request lifecycle management system that allows for the cancellation of active requests, the setting of timeouts, and the monitoring of upload and download transfer progress. It includes a mechanism for intercepting network traffic, enabling the transformation of outgoing requests and inco

    JavaScript
    Ver en GitHub↗109,096
Ver las 30 alternativas a Ofetch→

Preguntas frecuentes

¿Qué hace unjs/ofetch?

ofetch is an HTTP client built on the native fetch API that adds automatic JSON serialization, request/response interceptors, configurable retry, and timeout handling. It provides descriptive error objects for non-OK responses and automatically parses response bodies based on their content type.

¿Cuáles son las características principales de unjs/ofetch?

Las características principales de unjs/ofetch son: Fetch API Wrappers, JSON Request Serializers, Automatic Body Deserializers, Response Body Parsing, HTTP Request Abstractions, HTTP Request Customization, Fetch-Based HTTP Clients, Client Instance Defaults.

¿Qué alternativas de código abierto existen para unjs/ofetch?

Las alternativas de código abierto para unjs/ofetch incluyen: sindresorhus/ky — 🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API. elbywan/wretch — Wretch is a chainable HTTP client library and Fetch API wrapper designed to simplify network request configuration,… forwardemail/superagent — Superagent is an isomorphic JavaScript HTTP client for sending network requests and processing responses across both… mzabriskie/axios — Axios is a promise-based HTTP client used to make asynchronous network requests in both browser and Node.js… axios/axios — Axios is an isomorphic, promise-based HTTP client designed for making asynchronous network requests across different… sindresorhus/got — Got is a promise-based HTTP request library for Node.js that supports HTTP/2 and streaming. It provides a system for…