A wrapper around node-fetch that automatically uses HTTP(S) proxy settings from environment variables (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY). Version 3.0.1, stable, low maintenance. Unlike tunnel-based solutions (e.g., request, proxy-agent), it uses direct HTTP connections without CONNECT tunneling for HTTP targets, which avoids certain compatibility issues but may not support HTTPS proxying. It is a thin wrapper, passing through most node-fetch API behavior.
npm install fetch-with-proxyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates default import and automatic proxy detection from environment variables.
Use dynamic import: const fetch = await import('fetch-with-proxy'); or downgrade to v2.x if CJS required.Use a tunnel-based library like https-proxy-agent if you need full CONNECT tunneling.
Upgrade node-fetch to v3 or stay on fetch-with-proxy v2 which supports node-fetch v2.
Explicitly set headers if required.
Restart process if environment changes, or use custom agent for dynamic proxy.
Add "type": "module" to package.json or use .mjs extension, or use dynamic import.
Use import fetch from 'fetch-with-proxy' (ESM) or const fetch = (await import('fetch-with-proxy')).default; for CJS.Use an HTTPS URL or switch to a tunnel-based proxy agent.