on-render
v1.0.3
Published
express middleware that execute a listener when a response render is called.
Downloads
8
Maintainers
Readme
on-render
express middleware that execute a listener when a response render is called.
install
$ npm install on-render
examples
var express = require('express');
var onRender = require('on-render');
var app = express();
var onRenderListener = onRender.create(function (req, res, rendering, view, options) {
console.log(rendering); // logged rendered content
});
app.use(onRenderListener);
api
onRender.create(listenerFunction)
Create express middleware that execute a listener function when a response render is called.
listenerFunction(req, res, rendering, view, options)
Called when a response render is called.
req
: express request objectres
: express response objectrendering
: rendered contents stringview
: rendered view nameoptions
: options object with rendering