# System map — sindresorhus/got

> Canonical page: https://codevetter.com/unpack/got/system-map

# System map — sindresorhus/got

Scanned commit e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4 (2026-09-20). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The runtime is a callable library instance built around a shared request engine. Factory code selects the outward Promise or stream interface, while Options centralizes configuration and Request owns transport lifecycle state. HTTP caching, DNS caching, and HTTP/2 pooling occupy separate state boundaries. Distribution and CI are defined by package.json, tsconfig.json, and one inspected GitHub Actions workflow.
- source/index.ts creates the default Got instance from new Options(), an empty handler list, and mutableDefaults:false, then exports the instance plus configuration, response, error, diagnostics, and factory APIs. — [source/index.ts#L1-L27](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/index.ts#L1-L27)
- create() constructs Request before dispatching handlers; its lastHandler calls flush() and returns either the Request stream or an asPromise() wrapper according to isStream. — [source/create.ts#L85-L118](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/create.ts#L85-L118) [source/create.ts#L120-L148](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/create.ts#L120-L148)
- Options owns cloned internals, raw merge history, and explicit-header state; merge() runs init hooks before assigning validated option setters and rejects unknown option keys. — [source/core/options.ts#L1643-L1653](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/options.ts#L1643-L1653) [source/core/options.ts#L1696-L1738](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/options.ts#L1696-L1738)
- Request extends Node Duplex and owns response metadata, redirect history, retry count, upload/download counters, active request, queued writes, timeout cancellation, and abort disposal. — [source/core/index.ts#L298-L342](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/index.ts#L298-L342)
- Default HTTPS transport uses https.request unless http2 is enabled; HTTP/2 auto() negotiates ALPN, chooses requestHttp2 for h2, and falls back to HTTP/1.1. — [source/core/options.ts#L3740-L3748](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/options.ts#L3740-L3748) [source/core/utils/http2-client.ts#L1674-L1708](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/utils/http2-client.ts#L1674-L1708)
- HTTP cache wrappers are retained per storage adapter by cacheableStore; DNS state is owned by DnsCache, and HTTP/2 connections are pooled in Http2Agent.sessions with pending-session and queue state. — [source/core/index.ts#L2174-L2179](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/index.ts#L2174-L2179) [source/core/index.ts#L2292-L2296](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/index.ts#L2292-L2296) [source/core/utils/dns-cache.ts#L242-L259](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/utils/dns-cache.ts#L242-L259) [source/core/utils/http2-client.ts#L639-L659](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/source/core/utils/http2-client.ts#L639-L659)
- The npm package is ESM, requires Node >=22, and publishes dist/source; build deletes dist and runs tsc, prepare invokes build, and tsconfig compiles source, test, and benchmark using an ES2024 target. — [package.json#L8-L26](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L8-L26) [tsconfig.json#L1-L17](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/tsconfig.json#L1-L17)
- npm test chains XO, tsc --noEmit, and AVA with the tsx ESM import hook; CI specifies npm install and npm run test on Ubuntu for Node 22, 24, and 26. — [package.json#L17-L22](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/package.json#L17-L22) [.github/workflows/main.yml#L8-L26](https://github.com/sindresorhus/got/blob/e1d87d2ced01d5b7d855a7dc8b091bf7b014a1e4/.github/workflows/main.yml#L8-L26)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
