connect-ua-parser

Integrates ua-parser with connect/express

connect-ua-parser

Integrates ua-parser with connect/express

npm install connect-ua-parser

Initialize the middleware with :

var connect = require('connect'),
    connectUaParser = require('connect-ua-parser'),
    app = connect();
 
app.use(connectUaParser());

By default, the middleware will parse the user-agent header using the ua-parser library and attach it to the request object at req.useragent.

Specifies the key on the request object the parsed user-agent info will be attached. Defaults to useragent.

Specifies whether to use the ua parser from the ua-parser library. Defaults to true.

Specifies whether to use the os parser from the ua-parser library. Defaults to true.

Specifies whether to use the device parser from the ua-parser library. Defaults to true.