Middleware for Express.js that formats HTTP request and response objects (including optional body capture) for logging. Version 1.0.0, single release. Differentiates from other logging middleware by providing separate callbacks for request and response capture, allowing fine-grained control over header/body logging via boolean or function options. Non-streaming response body capture only. Designed for Node.js Express apps.
npm install shiny-express-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Express app with request and response formatter middleware, including callbacks and body capture options.
Ensure app.use(express.json()) is called before requestFormatter.formatRequests().
Use for non-streaming endpoints only.
Wrap callbacks in try-catch or ensure they are error-tolerant.
Set captureRequestBody: true or provide a filter function.
Ensure requestFormatter.formatRequests() is added before your routes.
Use const requestFormatter = require('shiny-express-formatter'); then call requestFormatter.formatRequests().Only expect body for non-streaming responses.