Modular utilities for enhancing `fetch` behavior. Bring Your Own Fetch implementation supports both [`node-fetch`](https://github.com/node-fetch/node-fetch) and [`unidici`](https://github.com/nodejs/undici)'s `fetch` (globally available in `node@18+`).
Modular utilities for enhancing fetch behavior. Bring Your Own Fetch implementation supports both node-fetch and unidici's fetch (globally available in node@18+).
withCache
The withCache function enhances fetch with RFC-7234 compliant cache behavior. The default cache is a simple in-memory Map, but custom caches are also supported.
import { withCache } from "ultrafetch";const enhancedFetch = withCache(fetch);
Any custom cache that adheres to a Map interface is valid.