| What it is | Tiny & elegant JavaScript HTTP client based on the Fetch API | Human-friendly and powerful HTTP request library for Node.js | An HTTP/1.1 client, written from scratch for Node.js | A better fetch API. Works on node, browser, and workers. |
| Features | - built on the Fetch API, no dependencies
- method shortcuts (ky.get, ky.post, ky.put, ky.patch, ky.delete, ky.head, ky.query)
- HTTPError for non-2xx responses, configurable per status
- retries with backoff, Retry-After support and custom retry rules
- per-attempt timeout and an overall totalTimeout
- maximum response size
- upload and download progress callbacks
- baseUrl and prefix options, searchParams
- All 13 features
| - promise API and stream API
- retries on failure, on by default
- advanced timeouts per request phase
- pagination API
- RFC 7234 compliant caching
- cookies
- HTTP/2 support
- proxy support and Unix domain sockets
- All 15 features
| - request, stream, pipeline, connect and upgrade APIs
- WHATWG fetch implementation, the one built into Node.js since v18
- Client, Pool, BalancedPool, RoundRobinPool and Agent dispatchers with keep-alive
- HTTP/2 when the server prefers it through ALPN (allowH2), and H2CClient for cleartext HTTP/2
- optional HTTP/1.1 pipelining
- ProxyAgent, EnvHttpProxyAgent (http_proxy, https_proxy, no_proxy) and Socks5ProxyAgent
- RetryAgent and retry handler
- interceptors: redirect, retry, dump, dns, cache, decompress, responseError and deduplicate
- All 19 features
| - automatic JSON parsing, Blob for binary content types
- automatic JSON body stringifying and headers
- FetchError with the parsed error body
- retries on configurable status codes, not by default for POST, PUT, PATCH and DELETE
- timeout option
- baseURL and query options
- typed responses
- onRequest, onRequestError, onResponse and onResponseError interceptors
- All 12 features
|
| Limitations | - Doesn't run on Node.js versions before 22: it needs Node.js 22 or later and the latest Chrome, Firefox or Safari
| - Doesn't run in the browser: it's an HTTP library for Node.js only
- Doesn't provide a CommonJS export: it's native ESM, so CommonJS projects must convert to ESM
| - Doesn't work without WebAssembly: its HTTP/1 parser needs it, so requests fail with ERR_WEBASSEMBLY_NOT_SUPPORTED under --jitless
- Doesn't support the Expect: 100-continue request header: it sends the body at once and ignores 100 Continue
- Doesn't implement CORS in fetch: no preflight requests or Access-Control-Allow-Origin checks
| |