detect-ua
v1.0.2
Published
A small user-agent detection library (1 kB)
Downloads
17,350
Readme
Detect user-agent
A small user-agent detection library (1 kB).
Is able to differentiate between mobile, tablet and desktop devices and finds your browser name and version.
Installation
Make sure you have Node.js installed.
$ npm install detect-ua
Usage
import { DetectUA } from 'detect-ua';
const device = new DetectUA();
console.log(device.browser); // -> { name: "Chrome", version: "80.0" }
console.log(device.isMobile); // -> false
console.log(device.isTablet); // -> false
console.log(device.isDesktop); // -> true
console.log(device.isMacOS); // { version: "10" }
console.log(device.isWindows); // -> false
console.log(device.isAndroid); // -> false
console.log(device.isiOS); // -> false
Development
$ yarn start
$ yarn lint
$ yarn test
$ yarn build
Licence
My work is released under the MIT license.