Got is an npm package that sends HTTP and HTTPS requests from Node.js with promises, streams, retries, timeouts, and JSON helpers. It is native ESM and targets server-side use rather than browsers.
Overview
Got is a Node.js HTTP request library aimed at ergonomic defaults and advanced control in application code. It exposes a promise-based main API plus streaming, pagination, and HTTPS-focused options, and documents comparison points against other Node HTTP clients.
JSON handling includes dedicated parsing and stringify hooks, a promise-level json method, and optional response validation through Standard Schema so typed payloads can be inferred from schemas. Errors can carry metadata, and timing information is available for debugging slow requests.
Reliability features include configurable retry on failure, granular timeout stages, redirect following, cookie support, gzip and deflate handling, and RFC 7234 compliant HTTP caching. Developers can create reusable instances, attach hooks, listen to progress events, compose plugins, route via HTTP or SOCKS proxies, and use Unix domain sockets.
The library advertises HTTP/2 support, TypeScript types, AWS-related integration notes, Diagnostics Channel hooks, and testing utilities. Maintainers note that browser-oriented users may prefer the related Ky package built on Fetch, while Got remains focused on Node runtimes.
Key features
- Promise and stream request APIs
- Automatic retries and advanced timeouts
- JSON mode with schema validation
- HTTP/2 and HTTPS support
- RFC 7234 compliant caching
- Proxy and Unix socket support
- Hooks, instances, and plugins
- TypeScript typings and progress events
Use cases
- Fetching APIs from Node.js services
- Long-running downloads with stream API
- Paginated HTTP crawling in scripts
- Cached repeated GET requests in apps
- Proxied or UNIX-socket internal calls