# universal-device

> System info.

Latest version **2.3.1** (published 2020-08-27) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install universal-device
pnpm add universal-device
yarn add universal-device
bun add universal-device
```

## 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 | 2.3.1 |
| Published | 2020-08-27 |
| First published | 2019-07-04 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | rax |
| Maintainers | rax-publisher, yacheng, zeroling |
| Keywords | Rax |

## Links

- npm: https://www.npmjs.com/package/universal-device
- npm.io page: https://npm.io/package/universal-device

## Dependencies (1)

- [universal-env](https://npm.io/package/universal-env.md) ^3.0.0

## Recent versions

- 2.3.1 (latest) — 2020-08-27
- 2.1.1-0 (beta) — 2020-04-03
- 2.3.0 — 2020-05-25
- 2.2.0 — 2020-04-20
- 2.1.1 — 2020-04-07
- 2.1.0 — 2020-04-03
- 2.1.0-1 — 2020-04-01
- 2.1.0-0 — 2020-04-01
- 2.0.0 — 2019-12-16
- 1.0.3 — 2019-11-28
- 1.0.2-beta.1 — 2019-11-01
- 1.0.2 — 2019-09-19
- 1.0.1 — 2019-09-17
- 1.0.0 — 2019-08-07
- 1.0.0-beta.1 — 2019-07-04

## README

# universal-device [![npm](https://img.shields.io/npm/v/universal-device.svg)](https://www.npmjs.com/package/universal-device)

System info.

## Supported
<img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> <img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px">

## Install
```bash
$ npm install universal-device --save
```

## Usage

```javascript

// How to use it in quickapp
// import { platform, appName, screenWidth, screenHeight, appVersion } from 'universal-device/lib/quickapp;

import { platform, appName, screenWidth, screenHeight, appVersion } from 'universal-device';

```

## APIS

### `appName: string`
app name or browser name

### `appVersion: string`
app version or browser version info

### `platform: string`
platform: 'Android'、'iOS'、'MacIntel', etc.

### `screenWidth: number`
Screen width in px

### `screenHeight: number`
Screen height in px

### `devicePixelRatio: number`
 The ratio of the resolution in physical pixels to the resolution in CSS pixels for the current display device.

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