A lightweight HTTP/S fetch wrapper that adds configurable timeout support with custom error messages. Current version 0.0.3 (last release unknown, appears low maintenance). Requires node-fetch as peer dependency for Node.js environments, but attempts to use window.fetch when available. Differentiates from similar packages by allowing a custom error string on timeout, and support for both ES5/CommonJS and ES6/ESM imports. The package is a fork of the original fetch-timeout with minor updates but no active development.
npm install upgraded-fetch-timeoutNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates default import and usage with custom timeout (5000ms) and custom error message.
Ensure window.fetch is defined in browser or install node-fetch peer dependency in Node.
Consider using native AbortController timeout for modern Node (>=15) and browsers.
Always pass a positive integer for timeout.
Handle errors manually in the .catch block instead of relying on the string error.
npm install node-fetch@^2.6.6
Use 'import fetchTimeout from 'upgraded-fetch-timeout'' (no curly braces).