Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

Pretender.js

github.com

  • Free plan
  • Web
7.1 Club score Visit github.com

What the maker publishes

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

Checked against the maker's pages on 11 Oct 2026.