{"id":13602329,"url":"https://github.com/skillnull/DeviceJs","last_synced_at":"2025-04-11T08:32:08.370Z","repository":{"id":44329655,"uuid":"132736014","full_name":"skillnull/DeviceJs","owner":"skillnull","description":"JS获取设备信息(操作系统信息、地理位置、UUID、横竖屏状态、设备类型、网络状态、浏览器信息、生成浏览器指纹、日期、生肖、周几等)","archived":false,"fork":false,"pushed_at":"2025-03-24T02:28:55.000Z","size":250,"stargazers_count":231,"open_issues_count":0,"forks_count":96,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T02:35:37.592Z","etag":null,"topics":["device","device-info","device-js","devicejs","javascript"],"latest_commit_sha":null,"homepage":"http://skillnull.com/others/DeviceJs/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skillnull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-09T09:47:03.000Z","updated_at":"2025-03-24T02:28:30.000Z","dependencies_parsed_at":"2024-01-16T22:20:24.127Z","dependency_job_id":"d3959784-a34c-4324-bc41-044839944989","html_url":"https://github.com/skillnull/DeviceJs","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"1ae178b4c523917119e33b78a5255fe00bf12302"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skillnull%2FDeviceJs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skillnull%2FDeviceJs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skillnull%2FDeviceJs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skillnull%2FDeviceJs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skillnull","download_url":"https://codeload.github.com/skillnull/DeviceJs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361599,"owners_count":21090939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["device","device-info","device-js","devicejs","javascript"],"created_at":"2024-08-01T18:01:20.293Z","updated_at":"2025-04-11T08:32:08.360Z","avatar_url":"https://github.com/skillnull.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"http://skillnull.com/others/images/DeviceJs.png\" width=\"300px\" alt=\"DeviceJS\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\" \u003e\n  \u003ca href=\"http://www.skillnull.com\"\u003e\u003cimg src=\"http://skillnull.com/others/images/brand/MIT.svg\" alt=\"License MIT\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003e #### CDN\n\n```html\n使用 UMD 格式\n\u003cscript src=\"https://www.unpkg.com/@skillnull/device-js@2.1.7/dist/device.js\"\u003e\u003c/script\u003e\n# or\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@skillnull/device-js@2.1.7/dist/device.js\"\u003e\u003c/script\u003e\n\n\n使用 ES 格式\n\u003cscript src=\"https://www.unpkg.com/@skillnull/device-js@2.1.7/dist/device.es.js\" type=\"module\"\u003e\u003c/script\u003e\n# or\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@skillnull/device-js@2.1.7/dist/device.es.js\" type=\"module\"\u003e\u003c/script\u003e\n```\n\n\u003e #### 安装\n\n```shell\n# NPM or YARN\n\nyarn add @skillnull/device-js\n\n# or with npm\n\nnpm install @skillnull/device-js\n```\n\n\u003e #### 调用\n\n```js\n// 使用 CDN 引用时，无需 import \nimport Device from '@skillnull/device-js'\n\n/**\n * @params:{\n *  domain: \u003cString\u003e 生成浏览器指纹所需，不传默认使用window.location.host;\n *  transferDateToLunar: \u003cString\u003e 要被转化为农历的日期，需要同时开启info中的lunarDate选项才生效\n *  info: \u003cArray\u003e 想要获取的信息，不传默认开启全部信息显示\n * }\n *\n * @return: 返回 Promise 对象\n */\n\nDevice.Info({\n  domain: 'your domain',\n  transferDateToLunar: '需要转化为农历的日期。例如： 2023/01/01。',\n  info: ['lunarDate']\n}).then(data =\u003e {\n  console.log(data)\n})\n\n// 或\n\nDevice.Info().then(data =\u003e {\n  console.log(data)\n})\n```\n\n\u003e #### INFO 配置项\n\u003e - deviceType: 设备类型\n\u003e - OS: 操作系统\n\u003e - OSVersion: 操作系统版本\n\u003e - platform: 操作系统平台\n\u003e - screenHeight: 屏幕高\n\u003e - screenWidth: 屏幕宽\n\u003e - language: 当前使用的语言-国家\n\u003e - netWork: 联网类型\n\u003e - orientation: 横竖屏\n\u003e - browserInfo: 浏览器信息\n\u003e - fingerprint: 浏览器指纹\n\u003e - userAgent: 包含 appCodeName,appName,appVersion,language,platform 等\n\u003e - geoPosition: 地理位置\n\u003e - date: 阳历日期时间\n\u003e - lunarDate: 阴历日期\n\u003e - week: 周几\n\u003e - UUID: 通用唯一标识 Universally Unique Identifier\n\n\u003e #### 在线地址: [https://skillnull.com/others/DeviceJs/index.html](https://skillnull.com/others/DeviceJs/index.html)\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskillnull%2FDeviceJs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskillnull%2FDeviceJs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskillnull%2FDeviceJs/lists"}