express-mobile-detection

[DEPRECATED] Express middleware to check useragent for mobile or tablet devices.

Express Mobile Detection

Express middleware which uses the client useragent to detect mobile and tablet devices.

It is not always wise to rely on useragents to determine mobile and tablet clients.

For all routes.

checkMobile = require('express-mobile-detection');
...
app.use(checkMobile());

For single routes.

checkMobile = require('express-mobile-detection');
...
app.get('/', checkMobile(), function (req, res) {
  console.log(req.mobile);
  console.log(req.tablet);
});

Licensed MIT unless otherwise noted. See LICENSE file.

This module uses public domain code from Chad Smith's detectmobilebrowsers.com project.