node-fetch

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

Library
npm
v3.3.2
8,856stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity16
Maintenance44
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture78
Code Quality74
Innovation80
Learning Curve85

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
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript59%
Python39%
Updated today
Python
49%
Other

Airbyte

Developer Tools · Data Engineering

21,916

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python49%
Kotlin42%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
Python
73%
MIT

CertMate

Security · Devops

1,382

Automate SSL certificate lifecycle across any CA, 24+ DNS providers, and every major secret store — with a REST API, web dashboard, and built-in MCP server for AI-driven ops.

View details
82
Repo Health
84
Technical
70
Dependency
Built with
Python73%
JavaScript12%
HTML12%
Updated yesterday
Java
48%
Apache 2.0

ClearFlask

Product Management · Community

448

Open-source feedback management and roadmap tool that lets product teams collect, prioritize, and respond to user input — with AI-powered summarization and full self-hosting control.

View details
83
Repo Health
73
Technical
63
Dependency
Built with
Java48%
TypeScript47%
Updated 2 weeks ago
C++
51%
Other

Cocos Engine

Developer Tools · Game Development · Design Tools

9,761

Open-source, cross-platform 2D/3D game engine with Vulkan, Metal, and WebGL support for web, mobile, and instant gaming platforms

View details
68
Repo Health
79
Technical
71
Dependency
Built with
C++51%
TypeScript35%
Updated 1 months 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

Search