I've built Fetrix, a lightweight and extensible HTTP client designed for modern JavaScript and TypeScript applications.
While Fetch API is great, I wanted an HTTP client that provides more control over requests, progress tracking, retries, and interceptors without adding external dependencies.
That's why I built Fetrix on top of XMLHttpRequest.
✨ What makes Fetrix different?
- Smart query parameter injection
- Automatic JSON body serialization
- Upload and download progress tracking
- Request and response interceptors
- Automatic retry on network failures and timeouts
- Request deduplication
- AbortController support
- Configurable timeout
- Custom HTTP status validation
- Multiple response types (JSON, Blob, Text, ArrayBuffer, Document, Response)
- FormData and multipart support
- Zero external dependencies
💻 Simple example
import fetrix from 'fetrix';
const users = await fetrix('https://api.example.com/users', {
method: 'GET',
params: {
limit: 10,
offset: 0
},
responseType: 'json'
});
console.log(users);
📦 Installation
npm install fetrix
🔗 Check it out
- Documentation: https://fetrix.devnax.com
- GitHub: https://github.com/devnax/fetrix
- npm: https://www.npmjs.com/package/fetrix
Fetrix is open-source and MIT licensed.
I'd appreciate feedback, suggestions, and contributions from the JavaScript community!
Top comments (0)