# @uni/system-info

Latest version **1.0.11** (published 2023-04-26) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @uni/system-info
pnpm add @uni/system-info
yarn add @uni/system-info
bun add @uni/system-info
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2023-04-26 |
| First published | 2021-02-26 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 186.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 271 |
| Author | rax |
| Maintainers | bunko, rax-publisher |

## Links

- npm: https://www.npmjs.com/package/@uni/system-info
- Repository: https://github.com/raxjs/universal-api
- Homepage: https://github.com/raxjs/universal-api#readme
- Issues: https://github.com/raxjs/universal-api/issues
- npm.io page: https://npm.io/package/@uni/system-info

## Dependencies (1)

- [@uni/env](https://npm.io/package/@uni/env.md) ^1.0.0

## Recent versions

- 1.0.11 (latest) — 2023-04-26
- 1.0.11-alpha.1 (alpha) — 2023-04-25
- 1.0.10-beta.0 (beta) — 2022-12-27
- 1.0.10-alpha.0 — 2023-04-24
- 1.0.10 — 2023-01-04
- 1.0.9 — 2022-11-17
- 1.0.8 — 2021-08-25
- 1.0.7 — 2021-08-24
- 1.0.6 — 2021-08-12
- 1.0.5 — 2021-07-06
- 1.0.4 — 2021-05-25
- 1.0.4-beta — 2021-05-19
- 1.0.3 — 2021-04-22
- 1.0.2 — 2021-04-14
- 1.0.1 — 2021-03-12
- … 3 more at https://npm.io/package/@uni/system-info/versions

## README

# systemInfo


[![npm](https://img.shields.io/npm/v/@uni/system-info.svg)](https://www.npmjs.com/package/@uni/system-info)

获取系统信息。

<div style="display: flex;flex-direction: row;justify-content: space-between;">
<div style="margin-right: 20px;max-width: 50%;">

## 支持

<img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" title="h5" /> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" title="阿里小程序" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px" title="微信小程序" /> <img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px" title="字节跳动小程序" /> <img alt="baiduSmartProgram" src="https://img.alicdn.com/imgextra/i4/O1CN01jngdBb24yGv2Fu34G_!!6000000007459-2-tps-200-200.png" width="25px" height="25px" title="百度小程序" /> <img alt="kuaiShouMiniProgram" src="https://gw.alicdn.com/imgextra/i4/O1CN01kzmJMM24jcFEzp5Wv_!!6000000007427-2-tps-200-200.png" width="25px" height="25px" title="快手小程序" />

## 安装

```bash
$ npm install @uni/system-info --save
```
or
```bash
$ npm install @uni/apis --save
```
## 示例

```javascript
import { getInfo, getInfoSync } from '@uni/system-info';

getInfo().then(res => console.log(res));
let res = getInfoSync();

```

你也可以从大包引入：
```js
import { systemInfo } from '@uni/apis';

systemInfo.getInfo().then(res => console.log(res));
let res = systemInfo.getInfoSync();

```

### 返回

| 成员 | 类型 | 描述 |
| --- | --- | --- |
| pixelRatio | `number` | 设备像素比 |
| screenWidth | `number` | 屏幕宽度，单位px |
| screenHeight | `number` | 屏幕高度，单位px |
| windowWidth | `number` | 可使用窗口宽度，单位px |
| windowHeight | `number` | 可使用窗口高度，单位px |
| language | `string` | 设置的语言，zh_CN 简体中文，zh_TW 繁体中文，en 英文 |
| version | `string` | 版本号 |
| platform | `string` | 客户端平台 |

</div>
<div>



<div style="display: flex;margin-top: 50px;">
  <div>
    <img src="https://img.alicdn.com/imgextra/i4/O1CN01XDvKVV1DKGftHeaEp_!!6000000000197-0-tps-616-638.jpg" width="220" height="200" />
    <div style="text-align: center;">微信小程序</div>
  </div>
</div>

</div>
</div>

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