How to handle user-agent in nodejs environment?
问题 I start to using the package "ua-parser" but the creator is too busy to mantain or commit... the npm ua-parser is outdate, and need to download directly from github. Someone know about other good package like ua-parser that is updated and can be used with expressjs? Or have a way to handle just with expressjs? 回答1: Have you looked at: https://github.com/biggora/express-useragent Or, write your own middleware: app.use(function(req, res, next) { res.locals.ua = req.get('User-Agent'); next(); })