{"id":22092210,"url":"https://github.com/pirxpilot/ua-query","last_synced_at":"2025-03-23T23:45:32.781Z","repository":{"id":57384295,"uuid":"77571267","full_name":"pirxpilot/ua-query","owner":"pirxpilot","description":"Lazy user agent string checker for connect compatible requests","archived":false,"fork":false,"pushed_at":"2024-03-29T06:40:45.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-01T00:48:04.192Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-29T01:04:42.000Z","updated_at":"2021-12-05T11:07:08.000Z","dependencies_parsed_at":"2022-09-01T01:00:39.297Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/ua-query","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fua-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fua-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fua-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fua-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/ua-query/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186927,"owners_count":20574554,"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-12-01T03:08:45.822Z","updated_at":"2025-03-23T23:45:32.749Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n\n# ua-query\n\nLazy user agent string checker for connect compatible requests\n\n## Install\n\n```sh\n$ npm install --save ua-query\n```\n\n## Usage\n\n```js\nvar ua = require('ua-query');\n\nfunction middleware(req, res, next) {\n  if (ua.isChrome(req, 45) || ua.isFirefox(req, 40)) {\n    res.locals.polyfills = false;\n  }\n}\n```\n\n## API\n\n`ua-query` functions take request as the first parameter and optionally version number as the second.\n\nbrowsers:\n- `isChrome(req[, version])`\n- `isFirefox(req[, version])`\n- `isSafari(req[, version])`\n- `isIE(req[, version])`\n- `isEdge(req[, version])`\n- `isBot(req[, version])` - a few strange bots\n\n\n- `isOld(browser, version)` - true if browser type matches but the version is older than specified version\n\nOS:\n- `isWindowsXP(req)`\n\n\n## In-browser usage\n\nWhen used in the browser `ua-query` will check self.navigator.userAgent. Browser-side API is similar to\nserver-side API but it skips `req` parameter.\n\n```js\nvar ua = require('ua-query');\n\nfunction isModern(req, res, next) {\n  return ua.isChrome(45) || ua.isFirefox(40);\n}\n```\n\n\n## License\n\nMIT © [Damian Krzeminski](https://pirxpilot.me)\n\n[npm-image]: https://img.shields.io/npm/v/ua-query\n[npm-url]: https://npmjs.org/package/ua-query\n\n[build-url]: https://github.com/pirxpilot/ua-query/actions/workflows/check.yaml\n[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/ua-query/check.yaml?branch=main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fua-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fua-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fua-query/lists"}