Skip to content

Instantly share code, notes, and snippets.

@marcelo-amorim
Created October 20, 2021 16:56
Show Gist options
  • Save marcelo-amorim/c2c70ece7919ae658bcfa159971f271a to your computer and use it in GitHub Desktop.
Save marcelo-amorim/c2c70ece7919ae658bcfa159971f271a to your computer and use it in GitHub Desktop.

Comparison

got request node-fetch ky axios superagent
HTTP/2 support ✔️¹ ✔️**
Browser support ✔️* ✔️ ✔️ ✔️
Promise API ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Stream API ✔️ ✔️ Node.js only ✔️
Pagination API ✔️
Request cancelation ✔️ ✔️ ✔️ ✔️ ✔️
RFC compliant caching ✔️
Cookies (out-of-box) ✔️ ✔️
Follows redirects ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Retries on failure ✔️ ✔️ ✔️
Progress events ✔️ ✔️*** Browser only ✔️
Handles gzip/deflate ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Advanced timeouts ✔️
Timings ✔️ ✔️
Errors with metadata ✔️ ✔️ ✔️
JSON mode ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Custom defaults ✔️ ✔️ ✔️ ✔️
Composable ✔️ ✔️
Hooks ✔️ ✔️ ✔️
Issues open
Issues closed
Downloads
Coverage TBD
Build
Bugs
Dependents
Install size
GitHub stars
TypeScript support
Last commit

* It's almost API compatible with the browser fetch API.
** Need to switch the protocol manually. Doesn't accept PUSH streams and doesn't reuse HTTP/2 sessions.
*** Currently, only DownloadProgress event is supported, UploadProgress event is not supported.
¹ Requires Node.js 15.10.0 or above.
❇️ Almost-stable feature, but the API may change. Don't hesitate to try it out!
❔ Feature in early stage of development. Very experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment