UAParser.js is an isomorphic JavaScript library, it can be run either in browser or node.js environment.
Download UAParser.js from the official GitHub repository: ua-parser-js, then place the following script tag in your HTML file to include the library:
In a server-side environment like Node.js, UAParser.js can parse the [User-Agent] and [Sec-CH-UA-*] headers from the incoming HTTP requests.
Although written in vanilla JavaScript, UAParser.js automatically detects the presence of jQuery (or Zepto) and creates a $.ua object in addition to the window.UAParser constructor.
"A great utility library to have when you're investigating what kind of users are visiting your website and how you can improve their UX. Supports most browsers out there."
"Thanks to the awesome people who make life so much easier for developers.. The evolution of the internet has made it critical that we detect the user's device type accurately to make our apps function better and look better.".