Template Helpers
Express/Response Properties: res.locals
This property is useful for exposing request-level information such as the request path name, authenticated user, user settings, and so on.
app.use(function(req, res, next){
res.locals.user = req.user;
res.locals.authenticated = ! req.user.anonymous;
next();
});將 helpers 放入 res.locals 中
就可以在 template 中(如 pug 中)使用 helpers