XHR Mocklet

JSON →
library 1.2.3 ·javascript
verified May 27, 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 14
actors 6 distinct systems
last hit 1d ago MetaBot
GPTBot
5
MetaBot
4
Script
1
Search engines
2

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