detect-ua
A small user-agent detection library (956 B)
Last updated 8 years ago by timvanscherpenzeel .
MIT · Original npm · Tarball · package.json
$ npm install detect-ua 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.0.2                                ...           latest (6 years ago)

15 Versions

  • 0.0.9                                ...           8 years ago
  • 0.0.8                                ...           8 years ago
  • 0.0.7                                ...           8 years ago
  • 0.0.6                                ...           8 years ago
  • 0.0.5                                ...           8 years ago
  • 0.0.4                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.12                                ...           7 years ago
  • 0.0.11                                ...           8 years ago
  • 0.0.10                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
Maintainers (1)
Downloads
Total 33
Today 0
This Week 0
This Month 18
Last Day 0
Last Week 7
Last Month 0
Dependencies (0)
None
Dev Dependencies (15)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE