https://github.com/jankapunkt/js-detect-os
Detect current running OS including version and codename.
https://github.com/jankapunkt/js-detect-os
browser detection hacktoberfest javascript navigator node-module operating-system
Last synced: 6 months ago
JSON representation
Detect current running OS including version and codename.
- Host: GitHub
- URL: https://github.com/jankapunkt/js-detect-os
- Owner: jankapunkt
- License: mit
- Created: 2019-11-23T11:52:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:25:44.000Z (almost 3 years ago)
- Last Synced: 2025-04-22T22:18:58.016Z (6 months ago)
- Topics: browser, detection, hacktoberfest, javascript, navigator, node-module, operating-system
- Language: JavaScript
- Homepage:
- Size: 787 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Detect OS in Javascript
[](https://github.com/jankapunkt/js-detect-os/actions/workflows/tests.yml)
[](https://standardjs.com)
[](https://www.repostatus.org/#active)
Detect current running OS including version and arch, if possible.
No dependencies. All code < 300 lines.This is just a minimal, simple and incomplete package to detect the following:
* os - Android, Windows, OSX, Linux etc. or undefined for unknown
* isMobile - true if a mobile OS, otherwise false
* name - For example "Ubuntu" when OS is "Linux" or undefined
* arch - 32, 64 or undefined
* ram - if `navigator.deviceMemory` is available or undefinedUses mainly `navigator.platform` and `navigator.userAgent` as second guess for detection.
No legacy support yet, no support for OS-minorites yet. **Feel free to contribute!**
## Why not use feature detection instead?
Yes we all know this is the better option. However, this package intends to
detect the OS and not the browser, so feature detection won't help that much.There are more distinct ways of detecting the OS based on certain ways of
feature **implementation** and results but that won't be covered by this package
(yet).## License
MIT, see [license](./LICENSE)