Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
bad! browser detection for mobile, tablet and touch
JavaScript
Branch: master
Failed to load latest commit information.
lib "updating version"
test "updating version"
.gitignore updating description
.travis.yml tavis working?
README.md Update README.md
index.js "updating version"
license "updating license"
package.json "updating version"

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.