Preparing for system design interviews?  Try bugzed.com →

XHR Mocklet

JSON →
library 1.2.3 ·javascript
verified Jun 17, 2026

`xhr-mocklet` is a lightweight utility designed for intercepting and mocking `XMLHttpRequest` objects in both browser and Node.js environments, primarily for unit testing. Currently at version 1.2.3, it receives updates as needed, indicated by recent patch releases addressing bug fixes and minor feature additions. The library allows developers to define custom responses for specific HTTP methods and URLs, simulate network errors, and trigger timeouts, providing fine-grained control over network interactions during tests. A key differentiator is its simplicity and direct focus on `XMLHttpRequest` mocking, offering a clear API for setup, teardown, and request handling. It also provides comprehensive TypeScript declaration files, ensuring a robust developer experience for TypeScript users.

total hits 12
actors 4 distinct systems
last hit 17d ago AhrefsBot
GPTBot
4
Amazonbot
4
Script
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany