@qualesme/http-fetch
v0.1.4
Published
Fetch-based implementation of @qualesme/http-core for browsers, Node >=18 and edge runtimes.
Downloads
16
Maintainers
Readme
@qualesme/http-fetch
Fetch-based implementation of @qualesme/http-core.
Works in browsers, Node >= 18 (global fetch), and edge runtimes (Workers, Deno).
Install
npm install @qualesme/http-fetch @qualesme/http-coreFor Node < 18, pass a polyfill via fetchImpl (e.g. undici):
import { fetch as undiciFetch } from 'undici';
const http = new FetchAdapter({ fetchImpl: undiciFetch });Usage
import { FetchAdapter } from "@qualesme/http-fetch";
const http = new FetchAdapter({
baseURL: "https://api.example.com",
defaultHeaders: { Accept: "application/json" },
});
// Full response
const res = await http.get("/ping");
console.log(res.status, res.headers, res.data);
// Data-only helpers
const data = await http.getData("/ping");License
MIT © 2025 Quales
