This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

device-detector

1.0.2 • Public • Published

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)

Dependents (2)

Package Sidebar

Install

npm i device-detector

Weekly Downloads

86

Version

1.0.2

License

MIT

Last publish

Collaborators

  • dongnd