🤏 Small (2.5kB MINIFIED + GZIPPED & 0 dependencies) and strong-typed HTTP client for Deno, Bun, Node.js, Cloudflare Workers and Browsers.
MIT License
Check our README for more information.
Published by fzn0x 4 months ago
Expose "browser" to published package
Full Changelog: https://github.com/fzn0x/hypf/compare/v0.2.0...v0.2.1
init
instead of createRequest
esm
module is not required anymore for CJS
Published by fzn0x 6 months ago
Upload File now supported in hypf!
Full Changelog: https://github.com/fzn0x/hypf/compare/0.0.9...0.1.0
Published by fzn0x 6 months ago
Introducing new HTTP error for Hypf, now you can handle HTTP errors easily if response was not ok (200)
export function createHTTPError(response: Response, responseData: Response) {
const code = response.status || response.status === 0 ? response.status : "";
const title = response.statusText || "";
const status = `${code} ${title}`.trim();
const reason = status ? `status code ${status}` : "an unknown error";
const error = new Error(reason);
error.name = "HTTPError";
(error as any).response = response;
(error as any).data = responseData;
return error;
}
Full Changelog: https://github.com/fzn0x/hypf/compare/0.0.8...0.0.9
Published by fzn0x 6 months ago
Published by fzn0x 6 months ago
Full Changelog: https://github.com/fzn0x/hypf/compare/0.0.6...0.0.7
Published by fzn0x 6 months ago
Hypf makes sure everything work smoothly.
Hypf started Deno support from deno_dist
folder, thanks to denoify
.
Hypf is working smoothly in Cloudflare Workers!
Now you can Infer Response Types!
const [getErr, getData] = await hypfRequest.get<
Array<{
userId: number;
id: number;
title: string;
body: string;
}>
>("/posts", {
retries: 3,
timeout: 5000,
});
getData?.[0]?.id; // number | undefined
Hypf Core now checking the support for Duplex explicitly.
since JS Runtimes was not implement full-duplex for fetch
yet.
Full Changelog: https://github.com/fzn0x/hypf/compare/0.0.5...0.0.6
Published by fzn0x 8 months ago
Full Changelog: https://github.com/fzn0x/hypf/compare/0.0.4...0.0.5
Published by fzn0x 8 months ago
Full Changelog: https://github.com/fzn0x/hypf/commits/0.0.4
Stage: Development