Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

express-modify-response

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

express-modify-response

middleware that allows you to modify the response sent

    1.0.2latest
    GitHub

Version published
Maintainers
1
Weekly downloads
740
decreased by-22.59%

Weekly downloads

Readme

Source

#express-modify-response

Example Usage

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>'; } ));

Keywords

FAQs

Last updated on 04 Nov 2016

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.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc