express-res-hook
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

express-res-hook

A middleware that gets executed before sending response

Install

$ npm i --save express-res-hook

Import

const express = require('express');
const resHook = require('express-res-hook');
 
const app = express();
 
app.use(resHook(function (data, finish) {
    // Your code, this will execute before sending response
    finish(data);// Needs to be called
}));
 
 
app.listen(3000, function () {
    console.log('Server is listening at port', 3000);
});

Package Sidebar

Install

npm i express-res-hook

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

2.93 kB

Total Files

5

Last publish

Collaborators

  • jugnuagrawal