Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

bad! browser detection for mobile, tablet and touch

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib "updating version" February 12, 2012
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore updating description January 31, 2012
Octocat-spinner-32 .travis.yml tavis working? February 01, 2012
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 license
Octocat-spinner-32 package.json "updating version" February 12, 2012
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.