[{"data":1,"prerenderedAt":556},["ShallowReactive",2],{"content:\u002Fposts\u002F2025\u002Fpackage-recommend-ua-parser-js":3,"surround:\u002Fposts\u002F2025\u002Fpackage-recommend-ua-parser-js":544},{"id":4,"title":5,"body":6,"canonical":523,"categories":524,"date":526,"description":527,"draft":528,"extension":529,"image":530,"meta":531,"navigation":532,"path":533,"permalink":523,"readingTime":534,"recommend":523,"references":523,"seo":539,"sitemap":540,"stem":541,"tags":542,"type":523,"updated":526,"__hash__":543},"content\u002Fposts\u002F2025\u002Fpackage-recommend-ua-parser-js.md","实用包推荐：ua-parser-js",{"type":7,"value":8,"toc":516},"minimark",[9,16,20,27,38,41,45,48,51],[10,11,12],"alert",{},[13,14,15],"p",{},"如果你有检测用户的一些行为的需求，可以看看这个包！",[17,18,19],"h2",{"id":19},"包功能说明",[13,21,22,23],{},"按它自己的说法，它是 ",[24,25,26],"code",{"code":26},"最全面、简洁且最新的 JavaScript 库，用于检测用户的浏览器、作系统、CPU 和设备类型\u002F型号。还能检测机器人、应用程序等。在浏览器（客户端）和 Node.js（服务器端）都能无缝运行。",[13,28,29,30,37],{},"在安装之前，你可以在 ",[31,32,36],"a",{"href":33,"rel":34},"https:\u002F\u002Fuaparser.dev\u002F",[35],"nofollow","uaparser"," 看看效果先。",[17,39,40],{"id":40},"效果展示",[42,43],"iframe",{"src":33,"style":44},"width: 100%;height: 400px",[17,46,47],{"id":47},"特别注意",[13,49,50],{},"它有两个版本：开源版分为MIT 协议和 AGPL 协议两种。商业版分为三种。各种的区别如下：",[52,53,54,55,54,74],"table",{},"\n    ",[56,57,58,59,54],"thead",{},"\n        ",[60,61,62,63,62,66,62,70,58],"tr",{},"\n            ",[64,65],"th",{},[64,67,69],{"colSpan":68},2,"开源版",[64,71,73],{"colSpan":72},3,"商业版",[75,76,58,77,58,98,58,119,58,136,58,153,58,170,58,187,58,203,58,218,58,233,58,248,58,263,58,278,58,293,58,311,58,326,58,341,58,356,58,375,58,392,58,410,58,428,58,443,58,458,54],"tbody",{},[60,78,62,79,62,83,62,86,62,89,62,92,62,95,58],{},[80,81,82],"td",{},"许可证",[80,84,85],{},"MIT (v1.x)",[80,87,88],{},"AGPL (v2.x)",[80,90,91],{},"PRO 个人",[80,93,94],{},"PRO 商务",[80,96,97],{},"PRO 企业",[60,99,62,100,62,103,62,110,62,113,62,115,62,117,58],{},[80,101,102],{},"浏览器检测",[80,104,105],{},[31,106,109],{"href":107,"title":108},"#demo","Basic detection","⚠️",[80,111,112],{},"✅",[80,114,112],{},[80,116,112],{},[80,118,112],{},[60,120,62,121,62,124,62,128,62,130,62,132,62,134,58],{},[80,122,123],{},"CPU 检测",[80,125,126],{},[31,127,109],{"href":107,"title":108},[80,129,112],{},[80,131,112],{},[80,133,112],{},[80,135,112],{},[60,137,62,138,62,141,62,145,62,147,62,149,62,151,58],{},[80,139,140],{},"设备检测",[80,142,143],{},[31,144,109],{"href":107,"title":108},[80,146,112],{},[80,148,112],{},[80,150,112],{},[80,152,112],{},[60,154,62,155,62,158,62,162,62,164,62,166,62,168,58],{},[80,156,157],{},"渲染引擎检测",[80,159,160],{},[31,161,109],{"href":107,"title":108},[80,163,112],{},[80,165,112],{},[80,167,112],{},[80,169,112],{},[60,171,62,172,62,175,62,179,62,181,62,183,62,185,58],{},[80,173,174],{},"操作系统检测",[80,176,177],{},[31,178,109],{"href":107,"title":108},[80,180,112],{},[80,182,112],{},[80,184,112],{},[80,186,112],{},[60,188,62,189,62,192,62,195,62,197,62,199,62,201,58],{},[80,190,191],{},"增强+准确性",[80,193,194],{},"❌",[80,196,112],{},[80,198,112],{},[80,200,112],{},[80,202,112],{},[60,204,62,205,62,208,62,210,62,212,62,214,62,216,58],{},[80,206,207],{},"机器人检测",[80,209,194],{},[80,211,112],{},[80,213,112],{},[80,215,112],{},[80,217,112],{},[60,219,62,220,62,223,62,225,62,227,62,229,62,231,58],{},[80,221,222],{},"AI 检测",[80,224,194],{},[80,226,112],{},[80,228,112],{},[80,230,112],{},[80,232,112],{},[60,234,62,235,62,238,62,240,62,242,62,244,62,246,58],{},[80,236,237],{},"额外检测（应用、图书馆、邮件、媒体播放器、爬虫等）",[80,239,194],{},[80,241,112],{},[80,243,112],{},[80,245,112],{},[80,247,112],{},[60,249,62,250,62,253,62,255,62,257,62,259,62,261,58],{},[80,251,252],{},"客户端提示支持",[80,254,194],{},[80,256,112],{},[80,258,112],{},[80,260,112],{},[80,262,112],{},[60,264,62,265,62,268,62,270,62,272,62,274,62,276,58],{},[80,266,267],{},"CommonJS 支持",[80,269,112],{},[80,271,112],{},[80,273,112],{},[80,275,112],{},[80,277,112],{},[60,279,62,280,62,283,62,285,62,287,62,289,62,291,58],{},[80,281,282],{},"ESM 支持",[80,284,194],{},[80,286,112],{},[80,288,112],{},[80,290,112],{},[80,292,112],{},[60,294,62,295,62,298,62,303,62,305,62,307,62,309,58],{},[80,296,297],{},"TypeScript 定义",[80,299,300],{},[31,301,112],{"href":107,"title":302},"Community version",[80,304,112],{},[80,306,112],{},[80,308,112],{},[80,310,112],{},[60,312,62,313,62,316,62,318,62,320,62,322,62,324,58],{},[80,314,315],{},"npm 模块可用",[80,317,112],{},[80,319,112],{},[80,321,112],{},[80,323,112],{},[80,325,112],{},[60,327,62,328,62,331,62,333,62,335,62,337,62,339,58],{},[80,329,330],{},"可直接下载",[80,332,112],{},[80,334,112],{},[80,336,112],{},[80,338,112],{},[80,340,112],{},[60,342,62,343,62,346,62,348,62,350,62,352,62,354,58],{},[80,344,345],{},"允许商业使用",[80,347,112],{},[80,349,112],{},[80,351,194],{},[80,353,112],{},[80,355,112],{},[60,357,62,358,62,361,62,363,62,369,62,371,62,373,58],{},[80,359,360],{},"宽容许可",[80,362,112],{},[80,364,365],{},[366,367,194],"strong",{"title":368},"Copyleft license",[80,370,112],{},[80,372,112],{},[80,374,112],{},[60,376,62,377,62,380,62,382,62,386,62,388,62,390,58],{},[80,378,379],{},"无开源义务",[80,381,112],{},[80,383,384],{},[366,385,194],{"title":368},[80,387,112],{},[80,389,112],{},[80,391,112],{},[60,393,62,394,62,397,62,399,62,401,62,403,62,408,58],{},[80,395,396],{},"无限终端产品",[80,398,112],{},[80,400,112],{},[80,402,112],{},[80,404,405],{},[366,406,194],{"title":407},"1 end-product per license",[80,409,112],{},[60,411,62,412,62,415,62,417,62,419,62,421,62,426,58],{},[80,413,414],{},"无限次数部署",[80,416,112],{},[80,418,112],{},[80,420,112],{},[80,422,423],{},[366,424,194],{"title":425},"1 TLD or deliverable per license",[80,427,112],{},[60,429,62,430,62,433,62,435,62,437,62,439,62,441,58],{},[80,431,432],{},"一年产品支持",[80,434,194],{},[80,436,194],{},[80,438,112],{},[80,440,112],{},[80,442,112],{},[60,444,62,445,62,448,62,450,62,452,62,454,62,456,58],{},[80,446,447],{},"终身更新",[80,449,112],{},[80,451,112],{},[80,453,112],{},[80,455,112],{},[80,457,112],{},[60,459,62,460,62,463,62,480,62,489,62,498,62,507,58],{},[80,461,462],{},"价格",[80,464,465],{},[366,466,468,469,473,474,479],{"title":467},"Pay as you want","FREE",[470,471,472],"sup",{},"*"," (",[31,475,478],{"target":476,"href":477},"_blank","https:\u002F\u002Fraw.githubusercontent.com\u002Ffaisalman\u002Fua-parser-js\u002F1.0.x\u002Flicense.md","License",")",[80,481,482],{},[366,483,468,484,473,486,479],{"title":467},[470,485,472],{},[31,487,478],{"target":476,"href":488},"https:\u002F\u002Fraw.githubusercontent.com\u002Ffaisalman\u002Fua-parser-js\u002Fmaster\u002FLICENSE.md",[80,490,491],{},[366,492,494,495,479],{"title":493},"$14 (one-time fee)","$14 (",[31,496,478],{"target":476,"href":497},"https:\u002F\u002Fraw.githubusercontent.com\u002Ffaisalman\u002Fua-parser-js\u002Fpro-personal\u002FLICENSE.md",[80,499,500],{},[366,501,503,504,479],{"title":502},"$29 (one-time fee)","$29 (",[31,505,478],{"target":476,"href":506},"https:\u002F\u002Fraw.githubusercontent.com\u002Ffaisalman\u002Fua-parser-js\u002Fpro-business\u002FLICENSE.md",[80,508,509],{},[366,510,512,513,479],{"title":511},"$599 (one-time fee)","$599 (",[31,514,478],{"target":476,"href":515},"https:\u002F\u002Fraw.githubusercontent.com\u002Ffaisalman\u002Fua-parser-js\u002Fpro-enterprise\u002FLICENSE.md",{"title":517,"searchDepth":518,"depth":518,"links":519},"",4,[520,521,522],{"id":19,"depth":68,"text":19},{"id":40,"depth":68,"text":40},{"id":47,"depth":68,"text":47},null,[525],"代码","2025-12-02 11:22:26","用于用于检测用户的浏览器、作系统、CPU 和设备类型\u002F型号。",false,"md","https:\u002F\u002Fbitmc.uno\u002Fpicgo\u002Fpackage-recommend-ua-parser-js.jpg",{},true,"\u002Fposts\u002F2025\u002Fpackage-recommend-ua-parser-js",{"text":535,"minutes":536,"time":537,"words":538},"1 min read",0.47,28200,94,{"title":5,"description":527},{"loc":533},"posts\u002F2025\u002Fpackage-recommend-ua-parser-js",[],"66BmyvLq5PbZc03_ZMTcLL7G7Fn4IPzrIMy___dmAxU",[545,550],{"title":546,"path":547,"stem":548,"date":549,"type":523,"children":-1},"【翻译】编写易于编译的TypeScript代码","\u002Fposts\u002F2025\u002Ftypescript-performance","posts\u002F2025\u002Ftypescript-performance","2025-11-05 18:00:24",{"title":551,"path":552,"stem":553,"date":554,"type":555,"children":-1},"乙巳项目结语","\u002Fposts\u002F2025\u002Fys-project-conclusion","posts\u002F2025\u002FYS-project-conclusion","2025-12-06 22:28:27","story",1789642588426]