# vigour-ua

> lightweight ua parser

Latest version **4.0.0** (published 2018-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install vigour-ua
pnpm add vigour-ua
yarn add vigour-ua
bun add vigour-ua
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2018-02-12 |
| First published | 2015-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/vigour-ua) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 122.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jim de Beer |
| Maintainers | jimdebeer, vigour-io |
| Keywords | useragent, browserify |

## Links

- npm: https://www.npmjs.com/package/vigour-ua
- Repository: https://github.com/vigour-io/ua
- Homepage: https://github.com/vigour-io/ua#readme
- Issues: https://github.com/vigour-io/ua/issues
- npm.io page: https://npm.io/package/vigour-ua

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2018-02-12
- 3.1.6 — 2017-08-15
- 3.1.5 — 2017-05-15
- 3.1.4 — 2017-05-11
- 3.1.3 — 2017-03-21
- 3.1.2 — 2017-03-20
- 3.1.1 — 2017-02-21
- 3.1.0 — 2017-02-12
- 3.0.1 — 2017-02-09
- 3.0.0 — 2017-01-16
- 2.2.3 — 2016-12-07
- 2.2.2 — 2016-12-07
- 2.2.0 — 2016-10-24
- 2.1.1 — 2016-09-08
- 2.1.0 — 2016-08-26
- … 15 more at https://npm.io/package/vigour-ua/versions

## README

# vigour-ua
<!-- VDOC.badges travis; npm; coveralls -->
<!-- DON'T EDIT THIS SECTION (including comments), INSTEAD RE-RUN `vdoc` TO UPDATE -->
[![Build Status](https://travis-ci.org/vigour-io/ua.svg?branch=master)](https://travis-ci.org/vigour-io/ua)
[![npm version](https://badge.fury.io/js/vigour-ua.svg)](https://badge.fury.io/js/vigour-ua)
[![Coverage Status](https://coveralls.io/repos/github/vigour-io/ua/badge.svg?branch=master)](https://coveralls.io/github/vigour-io/ua?branch=master)
<!-- VDOC END -->


ua parser with a light footprint (~1kb)

### parse user agent strings
```javascript
var ua = require('vigour-ua')
var userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.3'
console.log(ua(userAgent))
```

outputs
```
{
  "browser": "chrome",
  "version": 46,
  "prefix": "webkit",
  "platform": "mac",
  "device": "desktop"
}
```

### merge into objects
```javascript
var ua = require('vigour-ua')
var someObject = {
  randomField: true
}
console.log(ua(userAgent, someObject))
```

outputs `someObject`
```
{
  "browser": "chrome",
  "version": 46,
  "prefix": "webkit",
  "platform": "mac",
  "device": "desktop",
  "randomField": true
}
```

*This useragent parser does not catch all useragents, if you encounter a device thats wrongly parsed add a test!*

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