detect-ua
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Detect user-agent

npm version

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.

Readme

Keywords

none

Package Sidebar

Install

npm i detect-ua

Weekly Downloads

2,950

Version

1.0.2

License

MIT

Unpacked Size

121 kB

Total Files

17

Last publish

Collaborators

  • timvanscherpenzeel