examples/view-locals/index.js
function count(req, res, next) {
  User.count(function(err, count){
    if (err) return next(err);
    req.count = count;
    next();
  })
}
function count(req, res, next) {
  User.count(function(err, count){
    if (err) return next(err);
    req.count = count;
    next();
  })
}
function count ( req , res , next ) { User . count ( function ( err , count ) { if ( err ) return next ( err ) ; req . count = count ; next ( ) ; } ) }
this approach is cleaner, less nesting and we have the variables available on the request object
this approach is cleaner less nesting and we have the variables available on the request object