An implementation of the WHATWG Fetch API for Node.js using Minipass streams. Version 6.0.0 requires Node >=22.22.2. This fork reimplements node-fetch with Minipass streams, offering faster and more deterministic timing. It differs from node-fetch by returning Minipass streams instead of Node core streams, and supports full TLS options for https requests. The API mirrors node-fetch, making it a drop-in replacement for streaming use cases.
npm install minipass-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Imports the default fetch function and makes a GET request with an Authorization header, parsing JSON response.
Use import statements. If you must use CommonJS, use dynamic import: const fetch = (await import('minipass-fetch')).default;Use Minipass stream methods (e.g., .on('data'), .pipe()). Do not assume node core stream API.Replace response.buffer() with response.arrayBuffer().
Use const data = await response.json(); not const text = await response.text(); const data = JSON.parse(text);
Use import fetch from 'minipass-fetch' or dynamic import: const fetch = (await import('minipass-fetch')).default;The body is a Minipass stream. Use Minipass methods like .on('data') or .pipe() from minipass. Alternatively, use response.buffer() or response.text().Correct import: import fetch from 'minipass-fetch'; (not import { fetch } from ...)