examples/view-locals/index.js
function count2(req, res, next) {
  User.count(function(err, count){
    if (err) return next(err);
    res.locals.count = count;
    next();
  })
}
function count2(req, res, next) {
  User.count(function(err, count){
    if (err) return next(err);
    res.locals.count = count;
    next();
  })
}
function count2 ( req , res , next ) { User . count ( function ( err , count ) { if ( err ) return next ( err ) ; res . locals . count = count ; next ( ) ; } ) }
this approach is much like the last however we're explicitly exposing the locals within each middleware  note that this may not always work well, for example here we filter the users in the middleware, which may not be ideal for our application. so in that sense the previous example is more flexible with `req.users`.
this approach is much like the last however we re explicitly exposing the locals within each middleware note that this may not always work well for example here we filter the users in the middleware which may not be ideal for our application . so in that sense the previous example is more flexible with req . users .