{"id":15486073,"url":"https://github.com/xtoolkit/nuxtjs-device","last_synced_at":"2025-04-22T17:10:26.762Z","repository":{"id":84549857,"uuid":"279032916","full_name":"xtoolkit/nuxtjs-device","owner":"xtoolkit","description":"Nuxtjs User Device information","archived":false,"fork":false,"pushed_at":"2021-11-14T09:21:40.000Z","size":33,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T06:42:08.131Z","etag":null,"topics":["nuxt","nuxtjs"],"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/xtoolkit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-12T09:34:14.000Z","updated_at":"2025-01-07T09:42:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"24467b5c-3dd0-4df3-93cd-5252a69cffee","html_url":"https://github.com/xtoolkit/nuxtjs-device","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"d8eed782ea82b4c4ab1e5aa7ddaf6ec4b87414a8"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtoolkit%2Fnuxtjs-device","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtoolkit%2Fnuxtjs-device/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtoolkit%2Fnuxtjs-device/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtoolkit%2Fnuxtjs-device/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtoolkit","download_url":"https://codeload.github.com/xtoolkit/nuxtjs-device/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285696,"owners_count":21405297,"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":["nuxt","nuxtjs"],"created_at":"2024-10-02T06:06:11.855Z","updated_at":"2025-04-22T17:10:26.710Z","avatar_url":"https://github.com/xtoolkit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nuxtjs User Device information [![npm (scoped with tag)](https://img.shields.io/npm/v/nuxtjs-device/latest.svg?style=flat-square)](https://npmjs.com/package/nuxtjs-device)\n\n\u003e user Device information for Nuxt.js based on [bowser](https://npmjs.com/bowser)\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n## Setup\n\n- Add `nuxtjs-device` dependency using npm to your project\n\n```sh\nnpm install nuxtjs-device --save\n```\n\n- Add `nuxtjs-device` to the `modules` section of your `nuxt.config.js` file\n\n```js\n{\n  modules: ['nuxtjs-device'];\n}\n```\n\n## Usage\n\n`nuxtjs-device` detect all of user device/browser information. You can use this module with \\$device insntant.\n\n```js\nconsole.log(this.$device.db)\n\n// output\n{\n  browser: {\n    name: \"Firefox\",\n    version: \"78.0\",\n    touch: false,\n    mouse: false,\n    ip: \"127.0.0.1\"\n  },\n  os: {\n    name: \"Windows\",\n    version: \"NT 10.0\",\n    versionName: \"10\"\n  },\n  platform: {\n    type: \"desktop\",\n    vendor: \"\",\n    model: \"\",\n    pwa: false\n  },\n  engine: {\n    name: \"Gecko\",\n    version: \"20100101\"\n  }\n}\n```\n\n### Filter\n\nYou could want to filter some particular browsers to provide any special support for them or make any workarounds. It could look like this:\n\n```js\nconst isValidBrowser = this.$device.filter({\n  // declare browsers per OS\n  windows: {\n    'internet explorer': '\u003e10'\n  },\n  macos: {\n    safari: '\u003e10.1'\n  },\n\n  // per platform (mobile, desktop or tablet)\n  mobile: {\n    safari: '\u003e=9',\n    'android browser': '\u003e3.10'\n  },\n\n  // or in general\n  chrome: '~20.1.1432',\n  firefox: '\u003e31',\n  opera: '\u003e=22',\n\n  // also supports equality operator\n  chrome: '=20.1.1432', // will match particular build only\n\n  // and loose-equality operator\n  chrome: '~20', // will match any 20.* sub-version\n  chrome: '~20.1' // will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1)\n});\n```\n\n## Development\n\n- Clone this repository\n- Install dependencies using `yarn install` or `npm install`\n- Start development server using `yarn run dev` or `npm run dev`\n- Point your browser to `http://localhost:3000`\n\n## License\n\n[MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtoolkit%2Fnuxtjs-device","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtoolkit%2Fnuxtjs-device","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtoolkit%2Fnuxtjs-device/lists"}