A light-weight module that brings the Fetch API to Node.js, providing a window.fetch-compatible interface for server-side HTTP requests.
node-fetch is a light-weight, spec-compliant module that implements the Fetch API for Node.js, allowing developers to use the familiar `fetch()` function for making HTTP requests in server-side JavaScript. It solves the problem of needing a consistent, promise-based HTTP client across browser and Node.js environments, replacing the need for older libraries like `request` or `axios` in many cases.
Node.js developers who want a modern, promise-based HTTP client with a browser-compatible API, particularly those building isomorphic applications or migrating from browser code to server-side.
Developers choose node-fetch for its minimal footprint, adherence to the Fetch API standard, and seamless integration with native Node.js streams and promises. It provides a familiar interface that reduces context switching and is optimized for performance in server environments.
A light-weight module that brings the Fetch API to Node.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Closely mirrors the browser Fetch API with clear documentation on differences, reducing context switching for developers building isomorphic applications.
Uses Node.js streams for request and response bodies, enabling memory-efficient handling of large data without loading entire payloads into memory.
Decodes gzip, deflate, and brotli content automatically and converts string outputs to UTF-8, simplifying response parsing.
Supports AbortController for request cancellation and provides spec-compliant FormData, Blob, and File implementations for multipart requests.
Version 3 dropped CommonJS support, forcing teams on older Node.js setups to use v2 or implement async import() workarounds, complicating upgrades.
Lacks features like automatic retries, timeouts beyond AbortSignal, and request/response interceptors, which are standard in alternatives like axios.
Deviates from the WHATWG spec by requiring manual logic for redirect: 'manual' options, which can lead to bugs in cross-environment code.