Ad 728 × 90

Breaking News

random

Show HN: I made a fetch client builder to make API calls simpler and safer https://ift.tt/v4khO3l

Show HN: I made a fetch client builder to make API calls simpler and safer I built this library because I kept rewriting the same fetch wrapper for every project. Each time, I needed the same core features: - Make fetch throw errors to integrate smoothly with libraries like TanStack Query - Add sensible defaults to the Fetch API, like a base URL and authentication headers - Validate responses for type safety when OpenAPI isn’t an option I also wanted the library to feel exactly like using fetch — no new API to learn, and no extra friction for my teammates. While there are other great options out there, I found many were either too rigid or too bulky. Doesn’t it feel wrong to ship a 14kb fetch library to the client? To keep up-fetch small and flexible, I took a simple approach: lightweight defaults, paired with inversion of control, so users can easily override what they need. The result? up-fetch weighs just 1.6kb gzipped, with built-in validation (powered by Standard Schema), configurable options, retries, timeouts, streaming & progress tracking, lifecycle hooks, and more. Check it out if you’ve got a minute — I’d love to gather some feedback! https://ift.tt/8B7yxa2 March 26, 2025 at 05:11AM
Show HN: I made a fetch client builder to make API calls simpler and safer https://ift.tt/v4khO3l Reviewed by Technology World News on March 26, 2025 Rating: 5

No comments:

Contact Form

Name

Email *

Message *

Powered by Blogger.