A feature-rich wrapper around node-fetch that adds built-in RFC 7234 compliant response caching, proxy support, abortable requests (AbortController), base URL resolution, automatic rejection of non-2xx/304 responses, and strict URL validation. Version 0.4.0-1 (pre-release). Based on make-fetch-happen and node-fetch-npm. Low release cadence (last release ~2019). Differentiates from plain node-fetch by bundling caching (to OS temp dir), proxy (reads npm config), and base URL support out of the box.
npm install wise-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Fetches a JSON API, demonstrates error handling for non-2xx responses, and parses JSON body.
Wrap fetch in try/catch and check err.response.status instead of relying on response.ok.
Consider migrating to native fetch (Node 18+) or node-fetch v3 with manual caching/proxy implementation.
Clear cache manually by deleting temp files if needed. Not configurable.
Explicitly set proxy: null to disable proxy, or set proxy option explicitly.
Use default import: const wiseFetch = require('wise-fetch');Add .catch() or try/catch around the fetch call.
Ensure URL is absolute and correctly formatted. Use baseUrl option for relative URLs.