awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目MCP 服务器关于排名机制媒体报道
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sindresorhus avatar

sindresorhus/ky

0
View on GitHub↗
16,943 星标·474 分支·TypeScript·MIT·10 次浏览

Ky

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

Features

  • Fetch-Based HTTP Clients - An HTTP client built on the Fetch API that simplifies requests with automatic error handling and retry logic.
  • Fetch API Wrappers - Wraps the native Fetch API with a cleaner interface, adding automatic error handling and retry logic.
  • Request Retries - Automatically retries failed requests with configurable limits, delays, backoff, and jitter.
  • Automatic Retry Clients - Automatically retries failed requests with configurable limits, delays, and jitter.
  • Configurable Retry Engines - Provides automatic retry of failed HTTP requests with configurable limits, delays, backoff, and jitter.
  • Configurable Retry Engines - Ky controls retry behavior with configurable limits, status codes, delays, jitter, and timeout handling to automatically retry failed requests.
  • HTTP Client Libraries - An HTTP client library built on the Fetch API for making requests with retries, timeouts, and error handling.
  • Request Cancellations - Leverages the standard AbortController API to cancel in-flight HTTP requests.
  • Client Instance Defaults - Builds reusable Ky instances with custom defaults supporting inheritance and option replacement.
  • HTTP Lifecycle Hooks - Allows request and response interception through lifecycle hooks for customization and authentication.
  • HTTP Retry Engines - Implements automatic retries with configurable limits, status codes, delays, jitter, and timeout handling.
  • Per-Attempt Timeouts - Applies per-attempt and total timeouts to requests, throwing a timeout error if the limit is exceeded.
  • Lightweight HTTP Clients - A minimal HTTP client for making requests with JSON handling, timeouts, and configurable retries.
  • Pre-Configured HTTP Clients - Creates reusable HTTP clients with custom defaults using extend or create.
  • HTTP Client Requests - Ky makes HTTP requests with a clean API, automatic error handling, retries, and timeouts for web and Node.js applications.
  • HTTP Error Handling - Ky controls how non-2xx status codes are handled with selective error throwing and retry logic for failed requests.
  • Request Cancellation - Ky aborts an in-flight request using the AbortController API, throwing an AbortError.
  • Request Lifecycle Hooks - Exposes hooks at initialization, before request, before retry, before error, and after response stages.
  • Base URL Mappers - Resolves relative request URLs against a specified base URL to simplify API endpoint configuration.
  • Standard Schema Validators - Validates JSON response bodies against Standard Schema libraries like Zod, throwing a validation error on mismatch.
  • JSON Request Serializers - Ky automatically serializes JavaScript objects to JSON and sets the appropriate Content-Type header for request bodies.
  • Hook-Triggered Retries - Ky triggers a retry from an afterResponse hook based on response content, even for successful status codes.
  • Bidirectional Progress Tracking - Ky reports progress of data transfer with percentage, bytes transferred, and chunk data for both uploads and downloads.
  • Automatic Token Refreshes - Refreshes expired authentication tokens by intercepting 401 responses and retrying requests with fresh credentials.
  • Hook-Based Token Refreshes - Retries requests with fresh authentication tokens when a 401 response is received, using before-retry hooks.
  • Response Schema Validators - Validates JSON response bodies against a schema, throwing an error on mismatch.
  • Fetch Function Mocking - Replaces the fetch function with a custom implementation to return predefined responses without network calls.
  • AbortController-Based Clients - Uses the standard AbortController API for consistent request cancellation across environments.
  • Schema-Based Response Validation - Parses JSON responses and validates them against a schema, throwing an error on mismatch.
  • Standard Schema Response Validators - Validates JSON response bodies against Standard Schema libraries like Zod, throwing an error on mismatch.
  • Fetch Overrides - Allows replacement of the default fetch implementation with a custom one for mocking or instrumentation.
  • Custom Fetch Implementations - Provides a mechanism to replace the default fetch function for testing and instrumentation purposes.
  • Form Data Submission - Ky submits FormData or URLSearchParams as request bodies, automatically setting the appropriate Content-Type header.
  • Selective Status Code Filtering - Ky controls whether non-2xx status codes throw an error, with optional per-status-code filtering.
  • Query Parameter Mergers - Ky merges query parameters into request URLs, combining them with any existing parameters already present in the input URL.
  • General Utilities - Lightweight HTTP client based on Fetch API.

Star 历史

sindresorhus/ky 的 Star 历史图表sindresorhus/ky 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Ky 的开源替代方案

相似的开源项目,按与 Ky 的功能重合度排序。
  • unjs/ofetchunjs 的头像

    unjs/ofetch

    5,316在 GitHub 上查看↗

    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 wh

    TypeScript
    在 GitHub 上查看↗5,316
  • mzabriskie/axiosmzabriskie 的头像

    mzabriskie/axios

    109,096在 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
    在 GitHub 上查看↗109,096
  • elbywan/wretchelbywan 的头像

    elbywan/wretch

    5,174在 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
    在 GitHub 上查看↗5,174
  • kittinunf/fuelkittinunf 的头像

    kittinunf/fuel

    4,652在 GitHub 上查看↗

    Fuel is a Kotlin HTTP client library for Android and Kotlin applications that handles both synchronous and asynchronous web requests. It functions as a network wrapper that supports executing calls via suspending functions in coroutines, reactive streams, and traditional callbacks. The library features built-in integration for Android LiveData to bind network responses directly to observable state holders for user interface updates. It also includes a JSON serialization client that utilizes customizable mappers to convert raw HTTP response bodies into structured data objects. Capability area

    Kotlinandroidhttp-clientkotlin
    在 GitHub 上查看↗4,652
查看 Ky 的所有 30 个替代方案→

常见问题解答

sindresorhus/ky 是做什么的?

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

sindresorhus/ky 的主要功能有哪些?

sindresorhus/ky 的主要功能包括:Fetch-Based HTTP Clients, Fetch API Wrappers, Request Retries, Automatic Retry Clients, Configurable Retry Engines, HTTP Client Libraries, Request Cancellations, Client Instance Defaults。

sindresorhus/ky 有哪些开源替代品?

sindresorhus/ky 的开源替代品包括: unjs/ofetch — ofetch is an HTTP client built on the native fetch API that adds automatic JSON serialization, request/response… mzabriskie/axios — Axios is a promise-based HTTP client used to make asynchronous network requests in both browser and Node.js… elbywan/wretch — Wretch is a chainable HTTP client library and Fetch API wrapper designed to simplify network request configuration,… kittinunf/fuel — Fuel is a Kotlin HTTP client library for Android and Kotlin applications that handles both synchronous and… urllib3/urllib3 — urllib3 is a Python HTTP client library used for sending network requests and receiving responses. It functions as an… sindresorhus/got — Got is a promise-based HTTP request library for Node.js that supports HTTP/2 and streaming. It provides a system for…