
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@jabybaby/request-replay
Advanced tools
A modular debugging tool to capture and replay HTTP requests for Node.js frameworks
A modular debugging tool that captures and replays HTTP requests for Node.js frameworks. Perfect for debugging API endpoints during development.
npm install request-replay-debugger
const express = require('express');
const { Express } = require('request-replay-debugger');
const app = express();
app.use(express.json());
// Create recorder instance
const recorder = new Express({
uiPort: 3001,
maxRequests: 100,
ignoreStatic: true,
ignorePaths: ['/health']
});
// Add middleware to capture requests
app.use(recorder.middleware());
// Your routes
app.get('/api/users', (req, res) => {
res.json({ users: [] });
});
app.listen(3000, () => {
console.log('Server running on http://localhost:3000');
// Start the UI server
recorder.startUI().then(() => {
console.log('Replay UI at http://localhost:3001');
});
});
const recorder = new Express({
uiPort: 3001, // Port for the UI server
maxRequests: 100, // Maximum requests to store
ignoreStatic: true, // Ignore .css, .js, .png, etc.
ignorePaths: ['/health', '/metrics'], // Paths to ignore
baseUrl: 'http://localhost:3000', // Base URL for replays
enableUI: true // Enable/disable UI server
});
const recorder = new Express(config);
// Middleware function
app.use(recorder.middleware());
// Start UI server
await recorder.startUI();
// Stop UI server
recorder.stopUI();
// Get all requests
const requests = recorder.getRequests();
// Get specific request
const request = recorder.getRequest(id);
// Replay request
const result = await recorder.replayRequest(id);
// Clear all requests
recorder.clearRequests();
// Listen for new requests
recorder.on('requestRecorded', (request) => {
console.log('New request:', request.method, request.url);
});
// Listen for replayed requests
recorder.on('requestReplayed', ({ id, replayResponse }) => {
console.log('Request replayed:', id);
});
// Listen for cleared requests
recorder.on('requestsCleared', () => {
console.log('All requests cleared');
});
Create a new framework implementation by extending BaseRecorder:
const { BaseRecorder } = require('request-replay-debugger');
class MyFramework extends BaseRecorder {
constructor(config) {
super(config);
}
middleware() {
return (req, res, next) => {
// Capture request details
const record = this.recordRequest(
req.method,
req.url,
req.headers,
req.body,
req.query,
// Optional: original response
{
statusCode: res.statusCode,
headers: res.headers,
body: responseBody
}
);
next();
};
}
}
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run tests
npm run test
# Run linting
npm run lint
# Type checking
npm run typecheck
Check out the complete example in examples/express-example/:
cd examples/express-example
npm install
npm start
Then visit:
MIT
FAQs
A modular debugging tool to capture and replay HTTP requests for Node.js frameworks
We found that @jabybaby/request-replay demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.