Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
bad! browser detection for mobile, tablet and touch
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
README.md
index.js
license
package.json

README.md

Node-bowser

Build Status

Small module to test if the browser is desktop, mobile, tablet and touch device

Install

npm install node-bowser

Usage

node-bowser have some methods available

  • node-bowser.isMobile(); : returns true if its mobile
  • node-bowser.isTablet(); : returns true if its a tablet
  • node-bowser.isTouch(); : returns true if its android, iphone, ipod
  • node-bowser.isDesktop(); : returns true if its not mobile and not tablet

Examples

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();

Help

it goes against some browser names, you can help to extend the list

Test

node-bowser.js is tested with vows

node test/main.js

using vows

License

See license

Something went wrong with that request. Please try again.