Skip to content

pinguxx/node-bowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

bad! browser detection for mobile, tablet and touch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published