A hackable, lightweight HTTP client built on the native fetch API, version 2.0.0. It offers a modular middleware system for request/response interception, support for abort signals and timeouts, and a tiny footprint (<4KB). Released as ESM + UMD with TypeScript types, it requires Node.js 16+ or 18+. Unlike axios or node-fetch, it has zero dependencies and fully leverages the native fetch available in modern Node.js and browsers.
npm install extended-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic GET request using createHttpClient with baseUrl, error handling via catch on the Response object.
In catch, use the Response object: err.status, err.statusText, err.formattedResponse (if you need parsed body).
Migrate from new HttpClient() to createHttpClient() and adjust middleware configuration to the new object shape.
Manually stringify complex query parameters or use flat key-value pairs.
Ensure every request middleware returns the modified options object.
Use 'import { createHttpClient } from 'extended-fetch'' then call createHttpClient().In catch: console.log(err.status, err.statusText);
Use { request: [...], response: [...] } in the config.No dependency data recorded yet.