# @jarvisniu/vue-ua

> Vue plugin to detect web environment by user-agent

Latest version **0.1.3** (published 2019-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jarvisniu/vue-ua
pnpm add @jarvisniu/vue-ua
yarn add @jarvisniu/vue-ua
bun add @jarvisniu/vue-ua
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-05-17 |
| First published | 2019-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jarvis Niu |
| Maintainers | jarvisniu |
| Keywords | vue, user agent, ua |

## Links

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

## Dependencies (1)

- [@jarvisniu/ua](https://npm.io/package/@jarvisniu/ua.md) ^0.1.1

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2019-05-17
- 0.1.2 — 2019-05-11
- 0.1.1 — 2019-05-11
- 0.1.0 — 2019-05-11

## README

# vue-ua

Vue plugin to detect web environment by user agent

## Usage

Install:

```bash
npm install @jarvisniu/vue-ua
```

Import:

```js
import Vue from 'vue'
import VueUA from '@jarvisniu/vue-ua'

// Simple usage
Vue.use(VueUA)

// With extending
Vue.use(VueUA, function (ua) {
  ua.isOpera = ua.value.includes('OPR/')
})
```

Use in template:

```html
<div v-if="$ua.isWindows">This is Windows</div>
```

Use in script:

```js
this.$ua.isWindows
// or
Vue.prototype.$ua.isWindows
```

## API

- OS
  - isWindows
  - isMacOS
  - isLinux
  - isUbuntu
  - isAndroid
  - isIOS
- Kernel
  - isChrome
  - isFirefox
  - isSafari
  - isEdge
  - isIE
- Platform
  - isElectron
  - isDesktop
  - isMobile
- In-App
  - isWechat
  - isAlipay

## License

MIT

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