1.0.2 • Published 6 years ago

device-detector v1.0.2

Weekly downloads
281
License
MIT
Repository
github
Last release
6 years ago

device-detector

Simple tool for detecting device info and bots.

NPM Build Status codecov Dependency Status NSP Status

Setup

Usage

DeviceDetector provides just one method named parse().

DeviceDetector.parse([userAgent]);

The only parameter "userAgent" is optional in web browser, but required in Node.js environment.

Example:

var ua = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
var deviceInfo = DeviceDetector.parse(ua);

deviceInfo is an object looks like this:

  {
    type: 'Bot',
    browser: '',
    engine: 'Googlebot',
    version: '2.1',
    os: ''
  }

Test

git clone https://github.com/ndaidong/device-detector.git
cd device-detector
npm install
npm test

License

The MIT License (MIT)

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.32

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.12

8 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago