{"id":20631842,"url":"https://github.com/andrelmlins/svelte-device-detector","last_synced_at":"2025-04-15T18:53:36.046Z","repository":{"id":42440987,"uuid":"267760519","full_name":"andrelmlins/svelte-device-detector","owner":"andrelmlins","description":"Render views on different device types","archived":false,"fork":false,"pushed_at":"2023-07-19T04:11:05.000Z","size":400,"stargazers_count":19,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T23:51:11.915Z","etag":null,"topics":["browser","detector","device","os","svelte"],"latest_commit_sha":null,"homepage":null,"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/andrelmlins.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":"2020-05-29T03:56:13.000Z","updated_at":"2024-05-01T16:56:14.000Z","dependencies_parsed_at":"2024-06-21T15:54:48.232Z","dependency_job_id":null,"html_url":"https://github.com/andrelmlins/svelte-device-detector","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.4642857142857143,"last_synced_commit":"a8c14f82197cf1c98f05a087b206f8e9bf3a452d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-device-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-device-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-device-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrelmlins%2Fsvelte-device-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrelmlins","download_url":"https://codeload.github.com/andrelmlins/svelte-device-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135761,"owners_count":21218365,"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":["browser","detector","device","os","svelte"],"created_at":"2024-11-16T14:13:54.319Z","updated_at":"2025-04-15T18:53:36.020Z","avatar_url":"https://github.com/andrelmlins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte Device Detector\n\n[![npm version](https://badge.fury.io/js/svelte-device-detector.svg)](https://www.npmjs.com/package/svelte-device-detector) \u0026bull; [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/svelte-device-detector/blob/master/LICENSE) \u0026bull; [![Build Status](https://travis-ci.com/andrelmlins/svelte-device-detector.svg?branch=master)](https://travis-ci.com/andrelmlins/svelte-device-detector)\n\nRender views on different device types.\n\n## Installation\n\n```\nnpm i svelte-device-detector\n// OR\nyarn add svelte-device-detector\n```\n\n\u003cem\u003eNote: to use this library in sapper, install as devDependency. See the [link](https://github.com/sveltejs/sapper-template#using-external-components).\u003c/em\u003e\n\n## Demo\n\nLocal demo:\n\n```\ngit clone https://github.com/andrelmlins/svelte-device-detector.git\ncd svelte-device-detector\nnpm install \u0026\u0026 npm run dev\n```\n\n## Examples\n\nAn example of how to use the library:\n\n```js\n\u003cscript\u003e\n  import DeviceDetector from \"svelte-device-detector\";\n\u003c/script\u003e\n\n\u003cDeviceDetector showInDevice=\"desktop\"\u003e\n  \u003cp\u003eDesktop\u003c/p\u003e\n\u003c/DeviceDetector\u003e\n\n\u003cDeviceDetector showInBrowser=\"chrome\" showInDevice=\"mobile\"\u003e\n  \u003cp\u003eMobile and Chrome\u003c/p\u003e\n\u003c/DeviceDetector\u003e\n\n\u003cDeviceDetector showInBrowser={[\"safari\", \"firefox\"]}\u003e\n  \u003cp\u003eSafari or Firefox\u003c/p\u003e\n\u003c/DeviceDetector\u003e\n```\n\n## Properties\n\nFor best results the values have these characteristics:\n\n- Ignores sensitive case\n- Ignore special character\n- Removing accents\n- Skips space\n\n| Prop          | Default | Type              | Description                             |\n| ------------- | ------- | ----------------- | --------------------------------------- |\n| showInDevice  | -       | `string`, `array` | Render view on device types             |\n| showInBrowser | -       | `string`, `array` | Render view on browser types            |\n| showInOs      | -       | `string`, `array` | Render view on operational system types |\n\n## NPM Statistics\n\nDownload stats for this NPM package\n\n[![NPM](https://nodei.co/npm/svelte-device-detector.png)](https://nodei.co/npm/svelte-device-detector/)\n\n## License\n\nSvelte Device Detector is open source software [licensed as MIT](https://github.com/andrelmlins/svelte-device-detector/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrelmlins%2Fsvelte-device-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrelmlins%2Fsvelte-device-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrelmlins%2Fsvelte-device-detector/lists"}