{"id":18246,"library":"connect-pause","title":"connect-pause","description":"A Connect/Express middleware for simulating latency during development. Version 0.1.0, last updated in 2013, with no recent releases. It allows pausing all or specific requests by a given number of milliseconds, and optionally returning an error after the delay. Lightweight and simple, it is suitable for debugging but lacks TypeScript support and has not seen recent maintenance.","status":"maintenance","version":"0.1.0","language":"javascript","source_language":"en","source_url":"git://github.com/flesler/connect-pause","tags":["javascript","connect","express","pause","delay","latency"],"install":[{"cmd":"npm install connect-pause","lang":"bash","label":"npm"},{"cmd":"yarn add connect-pause","lang":"bash","label":"yarn"},{"cmd":"pnpm add connect-pause","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ES modules are supported if the environment supports them; CommonJS require also works.","wrong":"const pause = require('connect-pause')","symbol":"default","correct":"import pause from 'connect-pause'"},{"note":"CommonJS pattern as used in Node.js with Express.","wrong":"","symbol":"default","correct":"const pause = require('connect-pause')"},{"note":"The package exports a single function as default, not a named export.","wrong":"import { pause } from 'connect-pause'","symbol":"pause","correct":"const pause = require('connect-pause')"}],"quickstart":{"code":"import express from 'express';\nimport pause from 'connect-pause';\n\nconst app = express();\napp.use(pause(2000)); // pause all requests by 2 seconds\napp.get('/', (req, res) => {\n  res.send('Response after 2 seconds');\n});\napp.listen(3000, () => console.log('Server running on port 3000'));","lang":"javascript","description":"Sets up an Express server that pauses all requests for 2 seconds before responding."},"warnings":[{"fix":"Consider using alternative middleware or maintaining the package yourself.","message":"Package has not been updated since 2013.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Set the error object's status or use a custom error handler.","message":"The error parameter is passed to next(), which Express interprets as an error and may not result in the expected status code.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap the middleware for compatibility if needed.","message":"Requires express or connect; not compatible with other frameworks without middleware adaptation.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install connect-pause' to install the package.","cause":"Package not installed or not found in node_modules.","error":"Cannot find module 'connect-pause'"},{"fix":"Use 'import pause from 'connect-pause'' or 'const pause = require('connect-pause')'.","cause":"Incorrect import: using named import instead of default import.","error":"TypeError: pause is not a function"},{"fix":"Call pause(ms) to return a middleware function, e.g., app.use(pause(1000)).","cause":"Passing arguments incorrectly or using the middleware without calling it.","error":"Error: middleware is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}