http2-aware fork of node-fetch 2.x, providing a window.fetch-compatible API in Node.js using native http2 where possible. Currently at v2.3.1-0 (pre-release), based on node-fetch 2.x with added http2 support. Key differentiators: seamless http2 upgrade for requests, falls back to http1.1 if not supported, maintains the same API surface as node-fetch. Lower adoption and less mature than node-fetch itself, but useful for services that require http2 connections.
npm install node-fetch-h2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic GET request with JSON response using node-fetch-h2 with http2 support.
Pin to exact version (e.g., 2.3.1-0) and test upgrades thoroughly.
Ensure the upstream server supports http2 or handle http1.1 responses.
Benchmark with your specific workload if performance is critical.
Use dynamic import() or set type: 'module' in package.json.
Use dynamic import: const fetch = await import('node-fetch-h2')Ensure you use import fetch from 'node-fetch-h2' (ESM) or const fetch = require('node-fetch-h2') (CJS, if supported)Check that the server is running and accessible on http1.1 or verify http2 support.