Small module to test if the browser is desktop, mobile, tablet and touch device
npm install node-bowser
node-bowser have some methods available
node-bowser.isMobile();
: returns true if its mobilenode-bowser.isTablet();
: returns true if its a tabletnode-bowser.isTouch();
: returns true if its android, iphone, ipodnode-bowser.isDesktop();
: returns true if its not mobile and not tablet
var node-bowser = require('node-bowser');
//req can be node request or connect/express request
var bt = new node-bowser(req);
bt.isMobile();
bt.isTablet();
bt.isTouch();
bt.isDesktop();
it goes against some browser names, you can help to extend the list
node-bowser.js
is tested with vows
node test/main.js
using vows
See license