res-promises
v1.0.0
Published
Express middleware that adds promises object and render method that waits for promises
Downloads
1
Maintainers
Readme
Purpose
This middleware adds two properties to express's res
object:
promises
- empty object for other middlewares to store promises onrenderAfterPromises
- method which waits for all promises onres.promises
to resolve before callingres.render
with promise resolutions
Install
npm install res-promises
Use
const express = require('express');
const resPromises = require('res-promises');
const app = express();
app.use(resPromises())
See example
dir for how to use with other middleware.
Options
resPromises([overrideResRender])
- boolean to overrideres
'srender
method. Default method name isrenderAfterPromises