conext
use co to write express middleware
install
npm i --save conext
check it yourself
source code (kind of),'use strict';var bluebird = ;module { var wrapped = bluebird; return gnlength >= 4 ? { wrapped; } : { wrapped; };}
usage
in 3.x, conext will help you call next()
if gn.length === 1
or gn.length === 2
, so you can avoid next()
to be called twice
var conext = ;app
If you are using CoffeeScript, it's more convenience for you to keep using next argument because you can use yield whenever you want
conext = require'conext' appuse conext res.locals.withOutYieldCompilesTo = 'normal function'; next appuse conext res.locals.withYieldCompilesTo = yield Promiseresolve'generator function'; next
license
MIT