{"id":18388056,"url":"https://github.com/methodgrab/is","last_synced_at":"2025-05-14T20:11:59.529Z","repository":{"id":9440053,"uuid":"61877463","full_name":"MethodGrab/is","owner":"MethodGrab","description":"Browser detection from a user agent string","archived":false,"fork":false,"pushed_at":"2022-12-31T07:46:18.000Z","size":1821,"stargazers_count":1,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-29T04:41:53.455Z","etag":null,"topics":["browser-detection","user-agent"],"latest_commit_sha":null,"homepage":null,"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/MethodGrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-24T10:36:13.000Z","updated_at":"2022-09-08T23:49:49.000Z","dependencies_parsed_at":"2023-01-11T20:12:13.448Z","dependency_job_id":null,"html_url":"https://github.com/MethodGrab/is","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/MethodGrab%2Fis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MethodGrab","download_url":"https://codeload.github.com/MethodGrab/is/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253354911,"owners_count":21895487,"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-detection","user-agent"],"created_at":"2024-11-06T01:30:35.066Z","updated_at":"2025-05-14T20:11:59.509Z","avatar_url":"https://github.com/MethodGrab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is [![Build Status](https://travis-ci.org/MethodGrab/is.svg?branch=master)](https://travis-ci.org/MethodGrab/is) [![npm](https://img.shields.io/npm/v/@methodgrab/is.svg)](https://www.npmjs.com/package/@methodgrab/is)\n\u003e Browser detection from a user agent string.\n\n\n## Why\nFeature detection is preferable but sometimes it's not enough to deal with device specific quirks.\n\n\n## Install\n```bash\nnpm install --save @methodgrab/is\n```\n\n\n## Usage\n\n### Basic\n```js\nconst is = require( '@methodgrab/is' );\n\nis.ios();\n// No UA specified, `navigator.userAgent` is used if possible\n// → `true` on iOS devices, `false` elsewhere\n```\n\n### Custom User Agent\nYou can pass a custom user agent when initializing the library:\n\n```js\nconst is = require( '@methodgrab/is' )( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36' );\n\nis.chrome();\n// → always `true`\n\nis.ios();\n// → always `false`\n```\n\nOr at run time:\n\n```js\nconst is = require( '@methodgrab/is' );\n\nis.chrome( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36' );\n// → always `true`\n\nis.ios( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36' );\n// → always `false`\n```\n\n\n## API\n\n### `is.iosVersion()`\nGet the `major`, `minor` \u0026 `patch` versions of iOS.  \nThe values for each will be `-1` if undefined or not iOS.  \n\nExample: iOS 9.3.2 → `{ major: 9, minor: 3, patch: 2 }`  \nExample: iOS 9.0 → `{ major: 9, minor: 0, patch: -1 }`  \nExample: OS X → `{ major: -1, minor: -1, patch: -1 }`  \n\n### `is.ios()`\nCheck if the user agent indicates that the device is iOS.\n\n### `is.safari()`\nCheck if the user agent indicates that the device is Safari.\n\n### `is.chrome()`\nCheck if the user agent indicates that the device is Chrome.\n\n### `is.ie()`\nCheck if the user agent indicates that the device is Internet Explorer.\n\n### `is.ie9()`\nCheck if the user agent indicates that the device is Internet Explorer 9.\n\n### `is.ie10()`\nCheck if the user agent indicates that the device is Internet Explorer 10.\n\n### `is.ie11()`\nCheck if the user agent indicates that the device is Internet Explorer 11.\n\n### `is.edge()`\nCheck if the user agent indicates that the device is Microsoft Edge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmethodgrab%2Fis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fis/lists"}