express-modify-response
Advanced tools
Weekly downloads
Readme
#express-modify-response
var expressModifyResponse = require('express-modify-response');
var app = ...
app.use(expressModifyResponse(
(req, res) => {
// return true if you want to modify the response later
if (res.getHeader('Content-Type').startsWith('text/html')) return true;
return false;
},
(req, res, body) => {
// body is a Buffer with the current response; return Buffer or string with the modified response
// can also return a Promise.
return body.toString() + '<script>console.log("hello");</script>';
}
));
FAQs
middleware that allows you to modify the response sent
The npm package express-modify-response receives a total of 566 weekly downloads. As such, express-modify-response popularity was classified as not popular.
We found that express-modify-response demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.