A TypeScript-ready fetch utility that attempts a direct HTTP request first and, on failure, automatically retries via a randomly selected proxy from a user-supplied pool. Version 1.0.2 is the current stable release. It differentiates by offering zero-config proxy fallback, a simple Promise-based API, and built-in TypeScript definitions. The constructor accepts a custom proxy-fetching function, enabling dynamic proxy lists.
npm install super-fetch-proxyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows instantiation with a proxy fetcher function and a fetch call with custom options.
Ensure proxyFetcher returns a Promise<string[]>.
Cast options as any if TypeScript complains: fetcher.fetch(url, options as any).
Bind the method: const FetchUtil = fetcher.fetch.bind(fetcher);
Pass extra arguments via rest parameters: new FetchWithProxyFallback(getProxies, ...args);
Ensure the argument is a function that returns a Promise<string[]>.
Make sure proxyFetcher returns a valid array of proxy strings.
Check network connectivity, proxy availability, and URL correctness.
No dependency data recorded yet.