express-simulate-latency
express.js middleware which simulates network latency. Use when testing local servers to simulate connections to remote servers.
Installing
With npm:
$ npm install j-/express-simulate-latency
Use
var simulateLatency = ;// use as middleware for all subsequent handlers...var smallLag = ;app;// ...or use as middleware for a specific routevar bigLag = ;var { /* callback logic */ }app;
Syntax
simulateLatency(options)
options
- Optional configurationoptions.min
- Optional minimum wait time. Will use 0 seconds by default.options.max
- Optional maximum wait time. Will use the value ofoptions.min
by default.