rest-emulator (v0.1.3) is a lightweight Express/Connect middleware for mocking REST APIs with configurable endpoints, query-based responses, HTTP method support, response codes, headers, and timeouts. Last published in 2017 with no recent updates. Differentiates from tools like json-server by providing a programmatic middleware approach for integration into existing Express apps, supporting file-based mock structures with presets.
npm install rest-emulatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up an Express server with a mock REST endpoint for /api/users returning JSON data.
Consider alternatives like json-server, msw, or miragejs.
Use require() to import the module.
Store the result of restEmulator(config) and use .middleware.
const restEmulator = require('rest-emulator');Store the instance first, then access .middleware.
No dependency data recorded yet.