hans-user-agent-parser
v1.0.4
Published
parser device name, touchable device, device kind
Downloads
2
Readme
hans-user-agent-parser
parser device name, touchable device, device kind
Table of contents
Installing Add the package to your project
npm i hans-user-agent-parser
using yarn
yarn add hans-user-agent-parser
Example
Export ua from hans-user-agent-parser
const ua = require('hans-user-agent-parser')
using TypeScript
import ua from 'hans-user-agent-parser'
const userAgent = ua()
User agent object
console.log(userAgent) //
{
device: 'desktop', //on of them ['desktop', 'tablet', 'mobile']
touchableDevice: boolean, //true if device has touch events
deviceName: 'macintosh' // on of device names
}
Device names
Desktop
- macintosh
- windows
- linux
Tablet
- ipad
- ipod
- x11
Mobile
- iphone
- android
- blackerry
- mini
- iemobile