node-fetch

A lightweight, spec-compliant implementation of the browser Fetch API for Node.js

Library
npm
v3.3.2
8,846 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
58 /100 Fair
Development Activity 8
Maintenance 44
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 78
Code Quality 74
Innovation 80
Learning Curve 85

node-fetch brings the familiar window.fetch() API to Node.js so server-side code can make HTTP requests using the same Promise-based, Request/Response-shaped interface browsers use. It talks directly to Node’s native http and https modules rather than wrapping another HTTP client, and handles gzip/deflate/brotli decompression, redirects, streaming bodies, and AbortController-based cancellation out of the box.

Because it mirrors the WHATWG Fetch spec closely, code written against node-fetch reads almost identically to browser fetch calls, which makes isomorphic (shared client/server) HTTP code easier to write and makes onboarding trivial for anyone who already knows fetch().

What You Get

  • A fetch() function with the same signature and Promise-based Response as browser fetch()
  • Request, Response, and Headers classes that mirror the WHATWG Fetch spec
  • Automatic gzip/deflate/brotli response decompression via node:zlib
  • Streaming request/response bodies backed by native Node streams
  • AbortController/AbortSignal support for request cancellation
  • Built-in support for data: URLs, Blob/File, and FormData (multipart) bodies

Common Use Cases

  • Calling third-party REST APIs from a Node.js backend without adding a heavyweight HTTP client dependency
  • Writing isomorphic utility code that runs unchanged in the browser and on the server
  • Proxying or relaying HTTP requests/responses (e.g. streaming a remote file straight to disk or to a client)
  • Server-side rendering or build tooling that needs to fetch remote data during a Node.js process

Under The Hood

Architecture

node-fetch implements the WHATWG Fetch API surface as ES modules under src/: index.js orchestrates the request/response lifecycle (redirect following, gzip/deflate/brotli decompression via node:zlib, abort-signal handling), delegating to request.js (builds Node http/https request options from a Fetch-spec-shaped Request class), response.js (wraps Node’s IncomingMessage stream), body.js (a shared Body mixin implementing text()/json()/arrayBuffer()/formData() over Node streams), and headers.js (a case-insensitive Headers implementation). Supporting utils/ modules handle referrer-policy resolution, redirect-status detection, and multipart form parsing, keeping cross-cutting spec logic out of the core orchestrator.

Tech Stack

Pure JavaScript (98%) with a small hand-written TypeScript typings file (@types/index.d.ts), published as an ESM-only package (“type”: “module”) targeting Node >=12.20.0/14.13.1/16+. Runtime dependencies are minimal and single-purpose — data-uri-to-buffer for data: URL support, fetch-blob for Blob/File, and formdata-polyfill for FormData — with no transitive HTTP client dependency, since it talks directly to node:http/https. Dev tooling uses mocha + c8 for tests/coverage, xo (an ESLint preset) for linting, and tsd for type-testing.

Code Quality

The test/ directory has 9 files (a large spec-conformance suite in main.js alongside headers.js, request.js, response.js, form-data.js, referrer.js, and external-encoding.js) run via mocha with c8 coverage reported to Coveralls, indicating deliberate, spec-driven test coverage rather than an afterthought. Error handling is centralized in src/errors/ with dedicated FetchError and AbortError classes rather than generic throws, and naming/structure closely track WHATWG Fetch terminology (Request, Response, Headers, Body), keeping the mental model aligned with browser fetch. Recent GitHub activity is low and maintenance has become infrequent, so code quality remains high but the project is no longer evolving quickly.

API Design node-fetch is designed as a drop-in for the browser fetch() signature — fetch(url, options) returning a Promise<Response> — so most developers can use it with zero new concepts. It re-exports Request, Response, Headers, FormData, Blob/File, and its error classes for parity with browser code, and it documents differences from client-side fetch explicitly (docs/v3-LIMITS.md) rather than leaving them for users to discover. The README is extensive, covering streams, cookies, custom agents, and TypeScript usage, which lowers the adoption barrier, though the ESM-only requirement introduced in v3 is a real migration/DX friction point for CommonJS consumers.

Used by 74 apps in this directory

TypeScript
96%
Other

superglue

AI Agents · Data Engineering · Developer Tools

2,066

superglue is an AI-agent-driven integration engine that turns plain-English descriptions of enterprise systems into production-grade API tools, ERP/CRM connectors, and data pipelines — self-hosted or cloud, Y Combinator-backed (W25).

View details
42
Repo Health
79
Technical
67
Dependency
Built with
TypeScript 96%
Updated 2 months ago
TypeScript
97%
AGPL 3.0

Swetrix

Analytics

1,213

Privacy-first, cookieless web analytics with error tracking, session replays, and performance monitoring — self-host or use Cloud.

View details
87
Repo Health
71
Technical
66
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 6 days ago
TypeScript
79%
MIT

Trench

Analytics · Data Engineering · Monitoring

1,665

Open-source event tracking infrastructure built on Kafka and ClickHouse that handles thousands of events per second on a single node, with full Segment API compatibility and no cookies.

View details
44
Repo Health
81
Technical
73
Dependency
Built with
TypeScript 79%
MDX 15%
Updated 6 months ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
JavaScript
74%
AGPL 3.0

Twake Drive

Collaboration · File Storage

989

Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.

View details
91
Repo Health
78
Technical
71
Dependency
Built with
JavaScript 74%
TypeScript 25%
Updated 1 weeks ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 1 weeks ago
TypeScript
99%
MIT

Umami

Analytics

39,609

Privacy-first web analytics that respects your users — self-hosted, cookieless, and GDPR compliant out of the box.

View details
95
Repo Health
83
Technical
67
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers