1.0.0 • Published 8 years ago

device-type v1.0.0

Weekly downloads
485
License
MIT
Repository
github
Last release
8 years ago

device-type

Identify a device based on HTTP headers - user-agent but also cloudfront's CloudFront-Is-*-Viewer-headers

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install device-type --save

Usage

import deviceType from 'device-type';
import http from 'http';

http.createServer(req => {
  console.log('device type:', deviceType(req));
});

Tests

npm install
npm test

Dependencies

  • mobile-detect: Device detection (phone, tablet, desktop, mobile grade, os, versions)

Dev Dependencies

License

MIT

Generated by package-json-to-readme