{"id":18820993,"url":"https://github.com/optonaut/detect-device","last_synced_at":"2026-01-17T19:30:17.385Z","repository":{"id":57211994,"uuid":"47685096","full_name":"optonaut/detect-device","owner":"optonaut","description":"Detects (mobile) device used based on screen dimensions (width, height, dppx). Includes list of all devices.","archived":false,"fork":false,"pushed_at":"2015-12-13T22:01:01.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T09:18:20.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/optonaut.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}},"created_at":"2015-12-09T10:39:52.000Z","updated_at":"2015-12-19T20:24:58.000Z","dependencies_parsed_at":"2022-09-05T23:51:36.985Z","dependency_job_id":null,"html_url":"https://github.com/optonaut/detect-device","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optonaut%2Fdetect-device","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optonaut%2Fdetect-device/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optonaut%2Fdetect-device/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optonaut%2Fdetect-device/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optonaut","download_url":"https://codeload.github.com/optonaut/detect-device/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758831,"owners_count":19692034,"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":[],"created_at":"2024-11-08T00:32:55.621Z","updated_at":"2026-01-17T19:30:17.314Z","avatar_url":"https://github.com/optonaut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# detect-device\nDetects (mobile) device used based on screen dimensions (width, height, dppx). Includes list of all devices.\n\n## Demo\n\n[Open this link](https://rawgit.com/optonaut/detect-device/master/dist/demo.html) on a mobile device. If it couldn't be detected please [open a pull request for it](https://github.com/optonaut/detect-device/compare).\n\n\n## Install\n\n```sh\n$ npm install detect-device\n```\n\n## Usage\n\n```js\nimport { detect, devices } = 'detect-devices'\n\nconst detectedDevice = detect()\nconsole.log(detectedDevice)\n\\\\ { \"name\": \"Apple iPhone 6\", \"width\": 750, \"height\": 1334, \"diagonal\": 4.7, \"ppi\": 326, \"dppx\": 2 }\n\nconst iPhone5 = detect({\n  width: 640,\n  height: 1136,\n  dppx: 2\n})\nconsole.log(iPhone5)\n\\\\ { \"name\": \"Apple iPhone 5\", \"width\": 640, \"height\": 1136, \"diagonal\": 4, \"ppi\": 326, \"dppx\": 2 }\n\nconsole.log(devices)\n// ... lists all available devices\n```\n\n### Device Properties\n\n#### `name`\nDescription of the device. Includes vendor and model.\n\n#### `height`\nAbsolute height of device screen in pixel.\n\n#### `height`\nAbsolute height of device screen in pixel.\n\n#### `diagonal`\nDiagonal screen size in inch.\n\n#### `frame`\nDistance between screen and device body in inch. (`deviceWidthInInch` - `screenWidthInInch`) / 2 = `frame`.\n\n#### `ppi`\nPoints per inch. [Read more](https://en.wikipedia.org/wiki/Pixel_density).\n\n#### `dppx`\nScaling factor. Sometimes also called \"retina\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptonaut%2Fdetect-device","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptonaut%2Fdetect-device","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptonaut%2Fdetect-device/lists"}