# @companycam/vibe-check 中文文档

规范地址：https://npmcn.com/package/%40companycam/vibe-check/

版本：0\.3\.0
npm 元数据更新时间：2026-11-06T16:02:47.336Z
中文译文更新时间：2026-11-10T13:22:18.644Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40companycam/vibe-check
原文对照：https://npmcn.com/package/%40companycam/vibe-check/?lang=original
项目主页：https://www.github.com/#readme
源码仓库：https://www.github.com/

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：45.1 kB，20 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>= 18\.0\.0
- 运行依赖：2 个
- peer 依赖：react \*，react-native \*，react-native-device-info \*，@react-native-community/netinfo \*
- 首次发布：2023-12-05T16:31:19.739Z
- 最新版本发布：2025-01-13T20:47:41.746Z
- 近 30 天下载量：20860（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：5（近 12 个月 0 个）

## 中文简介

CompanyCam 的硬件记录库

## 安装

```sh
npm install @companycam/vibe-check
```

也可以使用：`pnpm add @companycam/vibe-check`、`yarn add @companycam/vibe-check`、`bun add @companycam/vibe-check`

## README

# @companycam/vibe-检查

## CompanyCam 的硬件记录库

欢迎来到Cam Vibe Check Repo公司.

该图书馆主要用于披露不易获得的硬件信息。 在我们的应用中保持高水平的性能是一大优先事项. 有时我们可以补偿这些问题,有时我们无法。 该图书馆旨在揭露通常与性能问题有关的硬件信息.

该图书馆通过图书馆披露以下信息: `getCurrentVibes` 方法 :

```js
{
  battery: {
    batteryLevel: 0.70202270953611340,
    batteryState: 'charging',
    lowPowerMode: false,
  },
  connectivity: {
    connection: {
      isConnected: true,
      isInternetReachable: true,
      type: 'cellular',
      details: {
        isConnectionExpensive: false,
        cellularGeneration: '4g',
      },
    },
  },
  memoryInUse: 83193856,
  thermalState: 'nominal',
};
```

## 安装

```sh
yarn install @companycam/vibe-check
```

```sh
yarn add @companycam/vibe-check
```

## 系统要求

### iOS系统

```
iOS Version: 15.0
```

### 机器人

```
minSdkVersion: 24
```

## 使用量

```js
import { getCurrentVibes, FullVibeCheck } from '@companycam/vibe-check';

// ...elsewhere in your code

const vibes: FullVibeCheck = yield call(getCurrentVibes);
```

## API 密码

### 方法

### 获取当前维布斯( )

获取设备当前硬件信息 。 这种方法是这个库的主要切入点. 返回此库所显示的其他函数的全部结果 .

```tsx
import { getCurrentVibes, FullVibeCheck } from '@companycam/vibe-check';

const vibes: FullVibeCheck = yield call(getCurrentVibes);
```

此方法将返回一个与以下 JSON 对象非常相近的对象 :

```js
{
  battery: {
    batteryLevel: 0.70202270953611340,
    batteryState: 'charging',
    lowPowerMode: false,
  },
  connectivity: {
    connection: {
      isConnected: true,
      isInternetReachable: true,
      type: 'cellular',
      details: {
        isConnectionExpensive: false,
        cellularGeneration: '4g',
      },
    },
  },
  memoryInUse: 83193856,
  thermalState: 'nominal',
};
```

### 获得Batterry Vibe ()

获取设备当前电池信息.

```tsx
import { VibeChecker } from '@companycam/companycam-vibe-check';

const { battery } = await NativeModules.VibeChecker.getBatteryVibe();
```

此方法将返回一个与以下 JSON 对象非常相近的对象 :

```js
  battery: {
    batteryLevel: 0.5,
    batteryState: 'unplugged',
    lowPowerMode: false,
    isBatteryCharging: false,
  }
```

### 获取连接Info ()

获取设备当前网络连接信息 .

```tsx
import { getConnectionInfo } from '@companycam/vibe-check';

const { connection } = await getConnectionInfo();
```

此方法将返回一个与以下 JSON 对象非常相近的对象 :

```js
  connection: {
    isConnected: true,
    isInternetReachable: true,
    type: 'cellular',
    details: {
      isConnectionExpensive: false,
      cellularGeneration: '4g',
    },
  }
```

### 获取 RamUsage ()

获得设备当前内存的使用率, 百分比 .

```tsx
import { getRamUsage } from '@companycam/vibe-check';

const { ramUsage } = await getRamUsage();
```

此方法将返回一个与以下 JSON 对象非常相近的对象 :

```js
ramUsage: 0.8; // <-- percentage
```

### 获得热态 ()

获得设备当前热能状态.

```tsx
import { getThermalState } from '@companycam/vibe-check';

const { thermalState } = await getThermalState();
```

此方法将返回一个与以下 JSON 对象非常相近的对象 :

```js
thermalState: 'fair';
```

注:自 `iOS` 财务报告和审定财务报表 `Android` 暴露不同的热能状态,我们已经把它们正常化了。 目前我们使用 `iOS` 不同热态的术语。 请参看下表.

| 热态 | iOS 值 | 安卓价值 |
| --- | --- | --- |
| `nominal` | `nominal` | `THERMAL_STATUS_NONE / THERMAL_STATUS_LIGHT` |
| `fair` | `fair` | `THERMAL_STATUS_MODERATE` |
| `serious` | `serious` | `THERMAL_STATUS_SEVERE` |
| `critical` | `critical` | `THERMAL_STATUS_CRITICAL / THERMAL_STATUS_EMERGENCY` |
| `unknown` | `unknown` | `unknown` |

## 返回对象潜在值

#### 电池

| 财产 | 类型 | 说明 |
| --- | --- | --- |
| `batteryLevel` | `number` | `The battery level on the device, from 0.0 to 1.0` |
| `batteryState` | `string` | `unknown`, (中文(简体) ), `unplugged`, (中文(简体) ), `charging`, (中文(简体) ), `full` |
| `lowPowerMode` | `bool` | `Whether or not the device is in low power mode` |

#### 连通性

| 财产 | 类型 | 说明 |
| --- | --- | --- |
| `isConnected` | `bool` | `Whether or not the device is connected to the internet` |
| `isInternetReachable` | `bool` | `Whether or not the device is connected to the internet` |
| `type` | `string` | `none`, (中文(简体) ), `unknown`, (中文(简体) ), `cellular`, (中文(简体) ), `wifi`, (中文(简体) ), `bluetooth`, (中文(简体) ), `ethernet`, (中文(简体) ), `wimax`, (中文(简体) ), `vpn` |
| `details` | `object` | `See below` |

##### 连接细节

| 财产 | 类型 | 说明 |
| --- | --- | --- |
| `isConnectionExpensive` | `bool` | `Whether or not the connection is expensive` |
| `cellularGeneration` | `string` | `2g`, (中文(简体) ), `3g`, (中文(简体) ), `4g`, (中文(简体) ), `5g`, (中文(简体) ), `unknown` |

#### 热态

| 财产 | 类型 | 说明 |
| --- | --- | --- |
| `thermalState` | `string` | `nominal`, (中文(简体) ), `fair`, (中文(简体) ), `serious`, (中文(简体) ), `critical` |

#### 内存使用

| 财产 | 类型 | 说明 |
| --- | --- | --- |
| `ramUsage` | `number` | `RAM Usage on the device from 0.0 to 1.0` |

## 捐款

该项目使用常规承诺和语义释放使释放过程自动化。 请跟随 [常规承诺](https://www.conventionalcommits.org/en/v1.0.0/) 格式中输入.

见 [贡献指南](https://npmcn.com/package/%40companycam/vibe-check/CONTRIBUTING.md) 学习如何为储存库和发展工作流程作出贡献.

制造的 [创建- 反应- 本土- 图书馆](https://github.com/callstack/react-native-builder-bob)

## 常见问题

### @companycam/vibe-check 是什么？

CompanyCam 的硬件记录库

### 如何安装 @companycam/vibe-check？

在项目目录运行 npm install @companycam/vibe-check，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\*）、react-native（\*）、react-native-device-info（\*）、@react-native-community/netinfo（\*）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @companycam/vibe-check 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @companycam/vibe-check 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @companycam/vibe-check 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>= 18\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @companycam/vibe-check 可以商用吗？

@companycam/vibe-check 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @companycam/vibe-check 的下载量有多少？

根据 npm 官方下载统计，@companycam/vibe-check 在 2026/10/11 – 2026/11/09 这 30 天内被下载 20,860 次，日均约 695 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @companycam/vibe-check 还在维护吗？

最新版本 0\.3\.0 发布于 2025/01/14（1\.8 年前）；至今共发布 5 个版本，其中过去 12 个月发布了 0 个；首次发布于 2023/12/06。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

