A powerful wrapper around the native fetch API that works in both Node.js (>=18) and browser environments. Current stable version is 2.0.5, released actively by ITW Creative Works. Key differentiators include automatic JSON response parsing, retries with exponential backoff, request timeouts via AbortController, authorization header management (auto-prefixes 'Bearer '), query parameter building, cache busting, file downloads (Node.js only), and enriched error objects with HTTP status codes. Designed to simplify common fetch patterns while retaining full flexibility.
npm install wonderful-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a basic GET request with JSON response, retries, timeout, and authorization header.
Upgrade Node.js to >=18 or use wonderful-fetch@1.x.
Access status, headers, and body individually or use a newer API pattern.
Pass authorization as 'Basic abc123' to avoid unwanted 'Bearer ' prefix.
For FormData or other body types, do not wrap in an object that triggers JSON serialization.
Guard file downloads with environment detection: if (typeof window === 'undefined') { /* download */ }Use import fetch from 'wonderful-fetch' (default import).
Pass a valid URL string as the first argument.
Check the URL or handle the error with try/catch and inspect err.status.
Only use 'download' in Node.js, or wrap with environment check.
No dependency data recorded yet.