express-ua

    0.0.9 • Public • Published

    express-ua

    NPM Version NPM Downloads Build Status Test Coverage

    Print YUI style userAgent info on html & req.ua Classify browser type by modern/mobile/obsolete

    Usage

    for express middleware:

        ...
        app.use(require('express-ua'))
        ...
        app.use(function(req, res, next){
            console.log(req.ua)
        })
        ...
        output example: 
      {
        os: 'Windows',
        browser: 'Chrome',
        ver: '40',
        isModern: true,
        isMobile: false,
        isObsolete: false
      }
    
    

    for jade template:

        html(class="#{ua&&ua.join(' ')||''}")
        <!-- <html class="ua-wk ua-wk40 ua-win"> -->
    

    License

    MIT

    Install

    npm i express-ua

    DownloadsWeekly Downloads

    4

    Version

    0.0.9

    License

    MIT

    Last publish

    Collaborators

    • cutsin