connect-ua-parser

0.1.0 • Public • Published

connect-ua-parser

Integrates ua-parser with connect/express

Installation

npm install connect-ua-parser

Usage

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.

Options

requestKey

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

ua

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

os

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

device

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

Readme

Keywords

none

Package Sidebar

Install

npm i connect-ua-parser

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • mlmorg