New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

browser-client

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-client

Detect browser, version, platform and device

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
14
600%
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 31 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts