talira

Compare

node-fetchundiciofetchGot
What it isA light-weight module that brings the Fetch API to Node.jsAn HTTP/1.1 client, written from scratch for Node.jsA better fetch API. Works on node, browser, and workers.Human-friendly and powerful HTTP request library for Node.js
KindOpen sourceOpen sourceOpen sourceOpen source
Trust0.110.320.320.34
Stars————
Last commit————
LicenceMITMITMITMIT
PricingFree and open sourceFree and open sourceFree and open sourceFree and open source
Free tierYesYesYesYes
Self-hostableYesYesYesYes
Ways to run it————
SOC 2————
HIPAA————
SSO————
APIYesYesYesYes
Plugins———Yes
MCP server————
Company—Node.js and OpenJS FoundationUnJS—
Features
  • window.fetch-compatible API
  • native promises and async functions
  • Node.js streams for request and response bodies
  • gzip, deflate and brotli decoding
  • redirect limit and response size limit
  • FetchError and AbortError types
  • AbortSignal cancellation
  • custom http.Agent
  • All 9 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
  • 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
Limitations
  • Doesn't load with require() in CommonJS from v3: version 3 is ESM only, and v2 stays CommonJS-compatible
  • Doesn't keep cookies between requests: there's no cookie store, so you read Set-Cookie headers yourself
  • Doesn't cache responses: there's no built-in HTTP caching
  • 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
    • 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