Negligible Participation Metric
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

ua_parser

1.2.4 • Public • Published

ua_parser

check browser and browser's version from userAgent

Build Status

NPM Stats

usage

browser


var ua = daumtools.userAgent(); // or window.ua_result

// result
{
    ua,
    browser: {
        [msie | edge | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: "msie" | "edge" | "safari" | "firefox" | "chrome" | "opera" | "android" | "iphone" | "ipad" | "ipod" | "polaris" | "dolfin" | "unknown", // type string
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    },
    platform : ["pc" | "tablet" | "mobile"], // type string
    os : {
        ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown"] : true,
        name : "windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown" // type string
    },
    app: {
        isApp: true | false, // type boolen
        name: "fxios" | "crios", // type string, fxios is firefox of iOS, crios is chrome of iOS.
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    }
}

nodejs

install


npm install ua_parser


var result = require("ua_parser").userAgent(USERAGENT_STRING);

// result
{
    ua,
    browser: {
        [msie | edge | safari | firefox | chrome | opera | android | iphone | ipad | ipod | polaris | dolfin | unknown] : true,
        name: "msie" | "edge" | "safari" | "firefox" | "chrome" | "opera" | "android" | "iphone" | "ipad" | "ipod" | "polaris" | "dolfin" | "unknown", // type string
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    },
    platform : ["pc" | "tablet" | "mobile"], // type string
    os : {
        ["windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown"] : true,
        name : "windows" | "mac" | "linux" | "android" | "ios" | "blackberry" | "chrome" | "unknown" // type string
    },
    app: {
        isApp: true | false, // type boolen
        name: "fxios" | "crios", // type string, fxios is firefox of iOS, crios is chrome of iOS.
        version: {
            info,  // type string (version full string : [major.minor.patch])
            major, // type string
            minor, // type string
            patch  // type string
        }
    }
}

NPM

install

npm i ua_parser

Downloadsweekly downloads

43

version

1.2.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability