npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

browser-device-js

v1.0.7

Published

browser-device-js 是一个轻量级获取浏览器和手机信息的库

Readme

介绍

browser-device-js 是一个轻量级获取浏览器和手机信息的库

优点

  1. 能够获取众多ios的机型,包括iphoneX

  2. 支持amd

  3. 区分 Edge IE11 IE11以下 Opera Firefox 微信内置浏览器 QQ浏览器 UC浏览器 Safari

Android 手机太多,没有基础数据,所以类型统一为Android 后面的版本数据会补上

如何获取

通过以下方式都可以下载:

执行npm i browser-device-js

如何使用

浏览器引入:


    直接引入
    <script src="browser-device-js/lib/device.js"></script>

模块引入:


    import Device from "browser-device-js"
    var d = new Device()
    d.getDevice() //获取所有信息
    /**
    {
        browserVer: "",//浏览器版本
        browserName: "",//浏览器名称 Edge IE11  IE Opera Firefox WeiXin QQ UC Safari
        phoneSystemType: "",//手机系统类型 android / ios
        phoneSystemVer: "",//手机系统版本  android 4.1 / ios 6
        phoneName: "",//iPhone 8 /iPhone X    Android  
    }

    **/
    d.getAndroidV()//获取android版本

    d.getIOSV()// 获取ios版本

    d.getPhoneSystemType()//获取 系统类型 ios /android  /Windows Phone

    d.isPC()//是否PC

    d.isMobile()//是否手机

    d.getBrowser()//获取浏览器名称 Edge IE11  IE Opera Firefox WeiXin QQ UC Safari

参考链接

https://github.com/joyqi/mobile-device-js