in-which-browser

    1.1.0 • Public • Published

    in-which-browser

    NPM version Build Status Coverage Status Known Vulnerabilities changelog license

    npm-image

    Detect browser user agent

    • Zepto.js Detect methods
      • inWhichBrowser.os
      • inWhichBrowser.browser
    • extends
      • inWhichBrowser.browser.wechat
      • inWhichBrowser.browser.wechatVersion
      • inWhichBrowser.browser.weapp

    Example

    import inWhichBrowser from 'in-which-browser';
    
    console.log(inWhichBrowser.os.ios);
    console.log(inWhichBrowser.os.android);
    
    console.log(inWhichBrowser.browser.wechat);
    console.log(inWhichBrowser.browser.wechatVersion);
    console.log(inWhichBrowser.browser.weapp);

    APIDoc

    为什么造轮子

    找了很多库都不太好使, 想到 Zepto 其实已经很成熟了, 因此"抽取"了它的 detect 模块, 再扩展自己的需求

    例如

    Install

    npm i in-which-browser

    DownloadsWeekly Downloads

    5

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    1.78 MB

    Total Files

    64

    Last publish

    Collaborators

    • ufologist