A tiny ES6 fetch() wrapper that simplifies common patterns: automatically sends cookies, allows setting default headers globally, and accepts plain JS objects as request body (auto-converted to FormData). Current stable version is 1.1.2, though the package appears unmaintained since 2016. Compared to alternatives like ky or axios, better-fetch is minimal and stays close to the native fetch API. It is likely compatible with both browser and Node.js environments that support fetch (or with polyfills). The library ships no TypeScript definitions and has no dependencies.
npm install better-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows default header setup, GET and POST requests with automatic cookie sending and body-to-FormData conversion.
Consider migrating to ky, cross-fetch, or native fetch if supported.
Ensure the request includes credentials: 'include' if needed, or use native fetch with explicit cookie handling.
If you need JSON body, pass JSON.stringify(data) and set Content-Type header manually.
Use import fetch from 'better-fetch' instead.
Ensure you use import fetch from 'better-fetch' (default import).
Use a fetch polyfill like node-fetch or cross-fetch.
No dependency data recorded yet.