Registry / http-networking / got

got

JSON →
library15.0.2jsnpmunverified

Got is a human-friendly and powerful HTTP request library for Node.js, currently at v15.0.2. It provides a modern Promise-based API for making HTTP requests, including features like retry mechanisms, hooks, and stream support. The library is actively maintained with frequent patch releases and major version updates that may introduce breaking changes, notably requiring Node.js 22+ and being ESM-only since v12 (reiterated in v15).

http-networking
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Got is native ESM. CommonJS `require()` is not supported.

import got from 'got';

Demonstrates making a POST request with a JSON payload and receiving a JSON response using Got's dedicated JSON mode.

import got from 'got'; (async () => { try { const { data } = await got.post('https://httpbin.org/anything', { json: { hello: 'world' } }).json(); console.log('Response data:', data); // Expected output: { "hello": "world" } } catch (error) { console.error('Request failed:', error); } })();
Debug
Known footguns
breakingGot v15.0.0 and later require Node.js 22 or higher.
breakingThe `promise.cancel()` API was removed in v15.0.0.
breakingThe `isStream` option has been removed in v15.0.0.
gotchaGot is a native ESM package and does not provide a CommonJS export. Attempting to `require()` it will result in an error.
gotchaThe `got` maintainers recommend considering `Ky` (for browser compatibility, smaller size, Fetch API base) or `fetch-extras` (for simpler needs) as alternatives.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
7 hits · last 30 days
ahrefsbot
4
script
1
bingbot
1
googlebot
1
Resources