Built a ~5KB Axios-Style JavaScript HTTP Client and Published It on npm: Axofy


A lightweight, zero-dependency HTTP client built with Fetch, designed around the features we actually use.
Lightweight HTTP clients are becoming more important as JavaScript apps grow. Most of us install a library, import a function, make a request, and move on.
But recently I asked myself a simple question:
What if I build the exact HTTP client I actually use every day?
No extra layers.
No huge bundle.
No unused features.
Just a fast, modern, ~5KB tool with the essentials we use in real projects.
That idea turned into Axofy — and I published it on npm.
🚀 What Is Axofy?
Axofy is a lightweight JavaScript HTTP client, inspired by the APIs we’re already comfortable with, but built with a very focused philosophy:
✅ only the features we actually use
✅ modern Fetch-based architecture
✅ works in both Node.js & the browser
✅ zero dependencies
✅ ~5KB package size
It supports:
GET / POST / PUT / PATCH / DELETE
interceptors (request & response)
baseURL support
timeout handling
automatic JSON parsing
config merging
consistent response structure
In other words:
Axofy gives you the useful parts of an HTTP client without the extra weight.
🧩 Why Build It?
This project didn't start with the intention of replacing existing libraries.
We already have great tools in the ecosystem.
My goal was simple:
Build a tiny, fast HTTP client that covers the features we actually use in real apps.
Most of the time, our usage looks like:
send a request
parse JSON
add headers
handle a timeout
maybe use interceptors
So instead of constantly importing large libraries for a small set of features, I wanted something minimal and modern.
🛠 How It Started
The earliest version of Axofy looked like this:
async function get(url) {
const res = await fetch(url);
return res.json();
}It worked—but it wasn’t reusable.
Then came the fun parts:
baseURL support
request interceptors
response interceptors
timeout using AbortController
config merging
unified response format
Piece by piece, it started feeling like a real library.
🌍 The Best Moment
After publishing to npm, I opened a new project and typed:
npm install axofyThen used it in a full-stack setup:
React frontend
Express backend
And it worked immediately.
That moment felt special.
Not because of the publish button…
…but because the tool I built was now being used exactly the way I always use others.
⚡ Why ~5KB Matters
In modern web apps, especially frontend-heavy ones, size matters.
Every dependency adds:
bundle weight
load time
complexity
vulnerability surface
A ~5KB library that does the job well is a huge win.
Small, fast, and focused.
🎯 Key Learnings
This project taught me things no tutorial ever did:
how request pipelines work internally
how to design a clean API surface
how publishing to npm actually works
how to think like a library author
how to write code others will use confidently
When you build the tools you normally import, your perspective changes completely.
🔗 Explore Axofy
GitHub:
https://github.com/vkakda/axofy
npm:
https://www.npmjs.com/package/axofy
✅ Final Thought
If you're a developer:
Try building something you usually install.
Even a small version.
You’ll understand it on a completely different level.
If you found this interesting or want a step-by-step breakdown of how I built and published Axofy as an npm package, let me know in the comments. I’d love to share the process.

Written by Vishal
Swayam Yatri (स्वयं यात्री) | Content writer ✍️ | Traveler (पथिक) 🏔️


