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

    1

    Version

    0.1.4

    License

    none

    Last publish

    Collaborators

    • vdemedes