Sunday, October 25, 2026 4,350 lists 78,100 records on file
List your app or device

  1. Home
  2. API Mocking Tools
  3. Pretender.js

Pretender.js

On the record

Browser only
Pretender temporarily replaces native XMLHttpRequest and Fetch to intercept requests, and the README says it only works in the browser.github.com · read 11 Oct 2026
Cleanup
The README instructs users to call shutdown() when finished to restore the native XMLHttpRequest object.github.com · read 11 Oct 2026
Installation
The README shows installation with yarn add -D pretender or npm install --save-dev pretender.github.com · read 4 Oct 2026
License
The package metadata identifies the license as MIT.github.com · read 11 Oct 2026
Maintenance activity
The Pretender organization page lists the repository as updated Jan 29, 2024.github.com · read 11 Oct 2026
Module use
The README shows Pretender loaded directly in a browser or imported as a module.github.com · read 4 Oct 2026
Pass-through
Configured requests can pass through Pretender and be sent as real XMLHttpRequests.github.com · read 11 Oct 2026
Purpose
Pretender is a mock server library for XMLHttpRequest and Fetch with an Express/Sinatra-style routing syntax.github.com · read 4 Oct 2026
Request tracking
Pretender tracks handled, unhandled, and pass-through requests, and request tracking can be disabled with an option.github.com · read 11 Oct 2026
Responses
Route handlers can return a response array containing an HTTP status, headers, and body, or return a Promise.github.com · read 11 Oct 2026
Response timing
Routes can respond asynchronously, synchronously, after a delay, or only when manually resolved.github.com · read 4 Oct 2026
Route methods
The routing DSL supports GET, PUT, POST, DELETE, PATCH, and HEAD methods.github.com · read 11 Oct 2026
Support and community
The project asks community members to follow its Code of Conduct and directs reports to a maintainer.github.com · read 4 Oct 2026
Support channel
The project repository provides an Issues page for reporting and discussing issues.github.com · read 11 Oct 2026
Timing controls
Routes can respond asynchronously, synchronously, after a delay, or only when manually resolved.github.com · read 11 Oct 2026
Usage
The README documents installation with npm or Yarn, direct browser script loading, and importing Pretender as a module.github.com · read 11 Oct 2026
What it does
Pretender is a mock server library for XMLHttpRequest and Fetch with an Express- or Sinatra-style syntax for defining routes and handlers.github.com · read 11 Oct 2026

Alternatives to Pretender.js

Every alternative, ranked