{"id":20902606,"url":"https://github.com/xulww/get-os-name","last_synced_at":"2025-05-13T03:31:19.193Z","repository":{"id":64984434,"uuid":"580321993","full_name":"xulww/get-os-name","owner":"xulww","description":"A simple and small npm package that gives you the operating system name of a client","archived":false,"fork":false,"pushed_at":"2023-01-03T14:32:59.000Z","size":15,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-06T18:02:13.114Z","etag":null,"topics":["android","browser","detect","ios","javascript","js","linux","macos","name","navigator","navigator-api","no-dependencies","npm","npm-package","operating-system","os","package","unix","web","windows"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/get-os-name","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/xulww.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}},"created_at":"2022-12-20T09:21:17.000Z","updated_at":"2023-10-22T08:30:36.000Z","dependencies_parsed_at":"2023-01-05T04:36:50.754Z","dependency_job_id":null,"html_url":"https://github.com/xulww/get-os-name","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulww%2Fget-os-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulww%2Fget-os-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulww%2Fget-os-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulww%2Fget-os-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xulww","download_url":"https://codeload.github.com/xulww/get-os-name/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253867546,"owners_count":21976247,"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":["android","browser","detect","ios","javascript","js","linux","macos","name","navigator","navigator-api","no-dependencies","npm","npm-package","operating-system","os","package","unix","web","windows"],"created_at":"2024-11-18T12:07:36.797Z","updated_at":"2025-05-13T03:31:19.184Z","avatar_url":"https://github.com/xulww.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-os-name\nThis is a very simple and small npm package that gives you the operating system name of a client. It has **no dependencies** and uses JavaScript and the \nNavigator Web API, which has [wide browser support](https://caniuse.com/mdn-api_navigator).\n\n## Installation\n```\nnpm install get-os-name\n```\n\n## Important\nTo be more specific, this package uses [navigator.userAgent](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent). Keep in mind that browser users can change \nthe value of this field if they want (UA spoofing).\n\n## Exports\n| Function name               | Return type | Description                                                                                                                         |\n| --------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| getOperatingSystemName      | string      | The default package export. A function that returns the name of the operating system (e.g. \"Windows\"). Fallbacks to \"Unknown\".      |\n| isUNIX                      | boolean     | A function that returns true if the operating system is UNIX                                                                        |\n| isWindows                   | boolean     | A function that returns true if the operating system is Windows                                                                     |\n| isMacOS                     | boolean     | A function that returns true if the operating system is macOS                                                                       |\n| isLinux                     | boolean     | A function that returns true if the operating system is Linux                                                                       |\n| isAndroid                   | boolean     | A function that returns true if the operating system is Android                                                                     |\n| isIOS                       | boolean     | A function that returns true if the operating system is iOS                                                                         |\n\n\n## Usage\n```javascript\nimport getOperatingSystemName, {\n  isUNIX,\n  isWindows,\n  isMacOS,\n  isLinux,\n  isAndroid,\n  isIOS,\n} from \"get-os-name\";\n\nconst osName = getOperatingSystemName()\nconst isOSNameUNIX = isUNIX()\nconst isOSNameWindows = isWindows()\nconst isOSNameMacOS = isMacOS()\nconst isOSNameLinux = isLinux()\nconst isOSNameAndroid = isAndroid()\nconst isOSNameIOS = isIOS()\n```\n[Demo](https://codesandbox.io/s/get-os-name-example-6ccr13)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxulww%2Fget-os-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxulww%2Fget-os-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxulww%2Fget-os-name/lists"}