0.3.2 • Published 10 years ago

q-locals v0.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

q-locals

Usage

var express = require('express');
var app = express();
require('q-locals')(app);

It will monkey-patch app object to overwrite #render() and #json() method to resolve promise properties of res.locals and the second parameter of #render() method. It will not recursively resolve deep properties which means res.locals.someProp.promiseHere will not be resolved automatically.

You can also patch on express:

require('q-locals')(express);

or create a object which is Object.created of response and overwrite #render() and #json() methods:

app.response = require('q-locals').createResponse(app.response);
0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago