2.0.0 • Published 8 years ago
connect-categorizr v2.0.0
connect-categorizr 
Connect middleware that provides device detection, based on Brett Jankord's Categorizr.
Installation
npm install connect-categorizrOptions
useSession: Store the device type in the session for quicker lookups on subsequent requests. Defaults totrue.
Usage
var connect = require('connect'),
categorizr = require('connect-categorizr');
var app = connect();
app.use(categorizr());The middleware will add the following immutable properties to the req object:
deviceType: String containing the matched device type (mobile,tablet,desktoportv)isMobile:trueif the device is a phoneisTablet:trueif the device is a tabletisDesktop:trueif the device is a desktop browserisTV:trueif the device is a TV
Testing
First, install the test dependencies
npm install -dand then run the tests
make test