# System map — unjs/ofetch

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

# System map — unjs/ofetch

Scanned commit 1dbc37fd1ceab832fc7c90cad81b1091c95ba563 (2026-07-08). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The system is a library consumed through an ESM package entrypoint. Seven source modules divide client creation, request execution, helpers, errors, and public types. State lives in factory closures and per-request contexts, while network behavior belongs to native or injected fetch. Build and CI configuration describe npm distribution and Node validation.
- The package identifies version 2.0.0-alpha.3, exports dist/index.mjs with dist/index.d.mts types, publishes only dist, and declares sideEffects false. — [package.json#L2-L14](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/package.json#L2-L14)
- src/index.ts re-exports runtime APIs through base.ts and public types, creates ofetch with its fetch wrapper, and exports $fetch as the same client. — [src/index.ts#L1-L15](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/index.ts#L1-L15) [src/base.ts#L1-L2](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/base.ts#L1-L2)
- The entrypoint wrapper allows later global fetch patching when fetch existed at import time; otherwise it installs a rejecting fallback. — [src/index.ts#L8-L11](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/index.ts#L8-L11)
- createFetch captures the transport, owns nested error/raw functions, and attaches raw, native, and create methods to the callable client. — [src/fetch.ts#L36-L39](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L36-L39) [src/fetch.ts#L259-L279](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L259-L279)
- fetch.ts orchestrates transport, utils.ts handles option resolution and hooks, utils.url.ts handles string URLs, and error.ts constructs contextual failures. — [src/fetch.ts#L1-L19](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L1-L19) [src/utils.ts#L85-L119](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/utils.ts#L85-L119) [src/utils.url.ts#L40-L51](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/utils.url.ts#L40-L51) [src/error.ts#L21-L42](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/error.ts#L21-L42)
- The inspected request pipeline stores transient state in FetchContext and response._data; transport is the external output boundary rather than a repository persistence layer. — [src/fetch.ts#L93-L103](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L93-L103) [src/fetch.ts#L180-L184](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/fetch.ts#L180-L184) [src/types.ts#L94-L99](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/types.ts#L94-L99) [src/types.ts#L137-L139](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/src/types.ts#L137-L139)
- pnpm 10.20.0 drives obuild, Vitest, ESLint, and Prettier scripts; release additionally invokes changelogen with alpha publishing and push flags. — [package.json#L15-L38](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/package.json#L15-L38) [pnpm-lock.yaml#L9-L46](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/pnpm-lock.yaml#L9-L46)
- CI declares Ubuntu jobs across Node 20, 22, and 24; autofix separately runs lint:fix with read-only contents permission and a pinned autofix action. — [.github/workflows/ci.yml#L5-L19](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/.github/workflows/ci.yml#L5-L19) [.github/workflows/autofix.yml#L5-L18](https://github.com/unjs/ofetch/blob/1dbc37fd1ceab832fc7c90cad81b1091c95ba563/.github/workflows/autofix.yml#L5-L18)

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)
