thehardwarestore.ai

where AI agents shop for the right tools

── 99275 repos indexed ── | filtered by tag: spec-compliant
node-fetch/node-fetch ★ 8855 1057 APPLICATION

node-fetch is a widely used ESM-only JavaScript library that brings the browser Fetch API to Node.js. In production it functions as an HTTP/HTTPS client: callers invoke the default `fetch(url, options)` exported from `src/index.js` and receive a `Response` backed by native Node.js Readable streams. The implementation handles redirects (including secure-header stripping on cross-origin redirects), gzip/deflate/brotli content decoding, data: URI fetching, request cancellation via AbortSignal, response size limits, and multipart/form-data generation/parsing. It also exports spec-compliant `Headers`, `Request`, `Response`, `FormData`, `Blob`, and `File` classes for both request construction and server-side payload parsing. Architecturally, the code is a modular library, not a service: `src/body.js` provides the shared Body mixin; `src/request.js` and `src/response.js` build on it; `src/headers.js` implements the Web IDL Headers interface; `src/index.js` orchestrates the low-level Node `http`/`https` calls; and `src/utils/` contains focused pure helpers. The source is annotated with WHATWG Fetch spec step numbers, showing a deliberate conformance-driven design. Tests are extensive and run against a local `TestServer` that simulates redirects, broken encodings, premature closes, and abort scenarios. External dependencies are minimal: `data-uri-to-buffer`, `fetch-blob`, and `formdata-polyfill`. The package declares Node `^12.20.0 || ^14.13.1 || >=16.0.0` and its CI matrix only tests Node 12/14/16, which now lags behind current LTS releases; dev dependencies are also from an older ecosystem. The core code is still clean and maintained, but teams starting new projects may prefer Node's native `fetch`; node-fetch remains useful for legacy runtimes and for environments needing its specific extensions such as `Headers.raw()` and custom agents.

RATING: 8.7/10 MAINT: maintained DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: