An ultra-lightweight wrapper around the native fetch API (<880B minified + brotlied) that provides a convenient, isomorphic interface for HTTP requests. Currently at version 0.2.6 (early development), it follows semver but expect frequent changes. Key differentiators: tiny size, built-in TypeScript types, interceptor support (similar to axios), automatic JSON serialization for object bodies, and URL query parameter handling. Released under the UnTS organization with conventional commits and changesets.
npm install x-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic GET and POST usage with query parameters and automatic JSON serialization.
Pin exact version and test upgrades.
Use import syntax or dynamic import() in CJS projects.
Upgrade Node to 18+ or install node-fetch and polyfill global fetch.
Use createXFetch() to create separate interceptor chains per context.
Change to import { xfetch } from 'x-fetch' or use dynamic import() if in CJS context.Use Node >= 18 or install a fetch polyfill like 'undici' and assign global.fetch.
Ensure 'moduleResolution' is 'node' or 'node16' in tsconfig.json. The package includes types.
No dependency data recorded yet.