# @financial-times/useragent_parser

> This is the VCL & JS implementation of the [ua-parser](https://github.com/tobie/ua-parser)

Latest version **1.6.3** (published 2022-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @financial-times/useragent_parser
pnpm add @financial-times/useragent_parser
yarn add @financial-times/useragent_parser
bun add @financial-times/useragent_parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.3 |
| Published | 2022-04-05 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jake Champion |
| Maintainers | nikita.lohia, notlee, efinlay24, emmalewis, aendra, the-ft, rowanmanning, chee, alexwilson |

## Links

- npm: https://www.npmjs.com/package/@financial-times/useragent_parser
- Repository: https://github.com/Financial-Times/useragent_parser
- Homepage: https://github.com/Financial-Times/useragent_parser#readme
- Issues: https://github.com/Financial-Times/useragent_parser/issues
- npm.io page: https://npm.io/package/@financial-times/useragent_parser

## Recent versions

- 1.6.3 (latest) — 2022-04-05
- 1.6.2 — 2022-03-16
- 1.6.1 — 2022-03-07
- 1.6.0 — 2021-04-20
- 1.5.1 — 2020-03-19
- 1.5.0 — 2020-03-17
- 1.4.1 — 2020-01-15
- 1.4.0 — 2020-01-13
- 1.3.1 — 2019-07-23
- 1.2.1 — 2019-07-03
- 1.2.0 — 2019-07-02
- 1.1.1 — 2019-07-01
- 1.0.3 — 2019-07-01
- 1.0.2 — 2019-01-10
- 1.0.1 — 2019-01-10

## README

# User Agent parser in VCL & JS

This is the VCL & JS implementation of the [ua-parser](https://github.com/tobie/ua-parser)

# Usage

## Updating

  `uap-core` definitions are, by default, compiled and included in the package. Updating `uap-core` is done every day via a GitHub Action.

# Example in VCL

For a request which was the user-agent Chrome 71.1:
```vcl
import ua_parser;

sub vcl_recv {
  call useragent_parser;
  # req.http.useragent_parser_family = "chrome";
  # req.http.useragent_parser_major = "71";
  # req.http.useragent_parser_minor = "1";
  # req.http.useragent_parser_patch = "0";
}
```

# Example in JS

```js
const useragent = require('@financial-times/useragent_parser');

console.log(useragent(request.headers['user-agent']))
/*
  {
    family: 'chrome',
    major: 71,
    minor: 1,
    patch: 0
  }
*/
```

---
_Source: https://npm.io/package/@financial-times/useragent_parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
