Closed vvotekeb closed 3 years ago
I haven't used ua-parser-js personnaly so I can't really compare but looking through their repo I'd say the main differences are:
device-detector-js has built-in types because it's written in typescript, no need to install an additional package. Type quality is usually better for packages written in TypeScript vs ones that maintain types separately like ua-parser-js.
device-detector-js is a lot heavier 454.2kB vs 15.1kB for ua-parser-js. I think this is because device-detector-js is able to detect more devices/browsers/bots/apps and as a result comes with more regexes for detection which increases the size of the package.
device-detector-js is not recommended if you plan on using it in the browser, mostly because of its size.
ua-parser-js doesn't seem to do bot/crawler detection, I may be wrong.
device-detector-js seems to have better test coverage based on the number of test fixtures, 130kb for ua-parser-js vs 5mb for device-detector-js.
Overall both package look pretty similar, I'd say if you plan to do user-agent detection in the browser, go with ua-parser-js because it's lighter in terms of package size (less bytes to send to your users).
What benefits does this library provide in comparison with https://github.com/faisalman/ua-parser-js ?