0.1.1 • Published 12 years ago

node-bowser v0.1.1

Weekly downloads
13
License
-
Repository
github
Last release
12 years ago

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