npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

browser-client

0.1.4 • Public • Published

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.

Keywords

none

install

npm i browser-client

Downloadsweekly downloads

0

version

0.1.4

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability