browser-client

Detect browser, version, platform and device

npm install browser-client
3 downloads in the last day
3 downloads in the last week
23 downloads in the last month

BrowserClient

Efficient and tiny connect middleware to detect browser, version, platform and device for Node.js.

Installation

npm install browser-client

How to use

Assuming app is your Connect or Express application instance:

var browserClient = require('browser-client');

app.use(browserClient());

Then, req.browserClient property will become available with such information:

Browsers:

req.browserClient.safari;
req.browserClient.firefox;
req.browserClient.chrome;
req.browserClient.opera;
req.browserClient.ie;
req.browserClient.mobileSafari;
req.browserClient.operaMini;

Devices:

req.browserClient.iphone;
req.browserClient.ipad;
req.browserClient.ipod;

Platforms:

req.browserClient.mobile;
req.browserClient.tablet;
req.browserClient.desktop;

OS:

req.browserClient.windows;
req.browserClient.mac;
req.browserClient.linux;

req.browserClient.ios;
req.browserClient.android;

All values are Boolean. Version number is available under req.browserClient.version.

General:

req.browserClient.browser;
req.browserClient.device;
req.browserClient.platform;
req.browserClient.os;

License

Copyright (c) 2013 Vadim Demedes Licensed under the MIT license.

npm loves you