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 🙏

© 2024 – Pkg Stats / Ryan Hefner

luo-device-info-vite

v0.0.1

Published

Get device information

Downloads

2

Readme

Luo-Device-Info-Vite

Get device information.

Install

npm install luo-device-info-vite -S

Usage

import getDeviceInfo from 'luo-device-info-vite';

getDeviceInfo({
  domain: '',
  info: ['browserInfo'],
}, function (data, methods) {
  console.log(data);
  console.log(methods);
});

参数

| 参数顺序 |参数类型 | 说明 | | ---------- | ----------- | ----------- | | 1 | Object | 初始时所需的参数 | | 2 | Function | 获取初始设备信息之后的回调函数 |

参数一 | 名称 | 值类型 | 说明 | | ---------- | ----------- | ----------- | | domain | String | domain为获取指纹信息所需的域名,一般为当前域名(location.host), | | info | Array | 可以指定想要获取哪些信息, 如:deviceType,OS,model,app,browserInfo,fingerprint,geoPosition,screen,language,netWork,orientation,userAgent,date,UUID,CPU |

参数二
1)第一个返回的为初始设备信息 | 名称 | 值类型 | 说明 | | ---------- | ----------- | ----------- | | deviceType | String | 返回设备类型,手机(Mobile),平板(Tablet),桌面电脑(Pc),电视(Tv),机器人(Bot),汽车设备(Car) | | OS | Object | 操作系统信息,name为操作系统名称,version为操作系统版本 | | model | Array或String | 设备型号, 如能识别唯一则为字符串,如可能为多种机型,则为数组 | | app | String | 当前为哪个应用,哪个app, aweme为抖音,tb为淘宝,ap为支付宝,dingtalk为钉钉,wxwork为企业微信,micromessenger为微信,qq为QQ,cloudstudy为云端学习 | | browserInfo | Object | 浏览器信息,kernel为内核,name为浏览器名称,version为浏览器版本 | | fingerprint | String | 系统网页指纹,(当前设备,当前或某个域名的唯一标识) | | geoPosition | Object | 地理位置信息(x纬度,y为经度) | | screen | Object | 屏幕信息,width为屏幕宽度,height为屏幕高度 | | language | String | 当前系统语言 | | netWork | String | 网络状态,如4g, 5g | | orientation | String | 横屏还是竖屏,transverse为横屏,vertical为竖屏 | | userAgent | String | 浏览器的userAgent头信息 | | date | Date | 当前时间 | | UUID | String | 唯一特征码 | | CPU | String | 设备的cpu信息 |

2)第二个返回值为方法 | 名称 | 值类型 | 说明 | | ---------- | ----------- | ----------- | | getDeviceType | String | 获取设备类型 | | getOs | Object | 获取操作系统信息 | | getScreenInfo | Object | 获取设备大小(宽/高) | | getLanguage | String | 获取语言 | | getNetWork | String | 获取网络状态 | | getOrientation | String | 获取横竖屏 | | getBrowserInfo | Object | 获取浏览器信息 | | getFingerprint | String | 获取指纹信息(参数为域名,空为当前域名) | | getUserAgent | String | 获取头信息 包含 appCodeName,appName,appVersion,language,platform 等 | | getPosition | String | 网络状态,如4g, 5g | | orientation | Object | 获取地理位置 | | getDate | Date | 获取当前时间 | | getUUID | String | 获取uuid唯一特征码 | | getBMap | Object | 获取百度地图api | | getModel | Array或String | 获取设备型号 | | getCPU | String | 获取CPU型号 | | getApp | Object | 获取app,name为app名,version为版本 |

License

This content is released under the MIT License.