# @adobe/inquirer-table-checkbox 中文文档

规范地址：https://npmcn.com/package/%40adobe/inquirer-table-checkbox/

版本：2\.0\.1
npm 元数据更新时间：2026-10-01T01:34:29.368Z
中文译文更新时间：2026-11-05T20:57:05.383Z
软件包许可：ISC

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

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

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

- 包体积（解压后）：26.2 kB，16 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=18
- 运行依赖：6 个
- 首次发布：2022-09-27T14:58:52.649Z
- 最新版本发布：2024-02-08T13:49:30.377Z
- 近 30 天下载量：23970（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：6（近 12 个月 0 个）

## 中文简介

问讯器的复选框提示( 作为多栏表)

## 安装

```sh
npm install @adobe/inquirer-table-checkbox
```

也可以使用：`pnpm add @adobe/inquirer-table-checkbox`、`yarn add @adobe/inquirer-table-checkbox`、`bun add @adobe/inquirer-table-checkbox`

## README

# 查询表检查框

[![Version](https://img.shields.io/npm/v/@adobe/inquirer-table-checkbox.svg)](https://npmjs.org/package/@adobe/inquirer-table-checkbox) [![Downloads/week](https://img.shields.io/npm/dw/@adobe/inquirer-table-checkbox.svg)](https://npmjs.org/package/@adobe/inquirer-table-checkbox) ![Node.js CI](https://github.com/adobe/inquirer-table-checkbox/workflows/Node.js%20CI/badge.svg) [![License](https://img.shields.io/badge/license-ISC-blue.svg)](https://opensource.org/licenses/ISC) [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/inquirer-table-checkbox/master.svg?style=flat-square)](https://codecov.io/gh/adobe/inquirer-table-checkbox/)

> 复选框提示( 作为多列表格) [问讯员.js](https://github.com/SBoudrias/Inquirer.js)
> 
> 基于 [查询表-即时](https://github.com/eduardoboucas/inquirer-table-prompt)

![Screen capture of the checkbox table prompt](https://npmcn.com/package/%40adobe/inquirer-table-checkbox/screen-capture.gif)

## 安装

```sh
npm install --save @adobe/inquirer-table-checkbox
```

## 使用量

```javascript
const inquirer = require("inquirer")
const inquirerTableCheckbox = require("@adobe/inquirer-table-checkbox")
inquirer.registerPrompt("table", inquirerTableCheckbox)

inquirer
  .prompt([
    {
      type: "table",
      name: "article",
      bottomContent: "visit Wikipedia",
      message: "Choose the article you want",
      wordWrap: true,
      pageSize: 2,
      style: { "padding-left": 1, "padding-right": 0, head: [], border: [] },
      colWidths: [30, 50],
      columns: [
        {
          name: "URL",
          wrapOnWordBoundary: false
        },
        {
          name: "Description",
          wrapOnWordBoundary: true
        }
      ],
      rows: [
        {
          value: "voyager",
          URL: "https://en.wikipedia.org/wiki/Voyager_program",
          Description:
            "The Voyager program is an American scientific program that employs two robotic interstellar probes, Voyager 1 and Voyager 2. They were launched in 1977 to take advantage of a favorable alignment of Jupiter and Saturn, to fly near them while collecting data for transmission back to Earth. After launch the decision was taken to send Voyager 2 near Uranus and Neptune to collect data for transmission back to Earth."
        },
        {
          value: "spacex",
          URL: "https://en.wikipedia.org/wiki/SpaceX",
          Description:
            "Space Exploration Technologies Corp. (doing business as SpaceX) is an American spacecraft manufacturer, space launch provider, and a satellite communications corporation headquartered in Hawthorne, California. SpaceX was founded in 2002 by Elon Musk, with the goal of reducing space transportation costs to enable the colonization of Mars. SpaceX manufactures the Falcon 9 and Falcon Heavy launch vehicles, several rocket engines, Cargo Dragon, crew spacecraft, and Starlink communications satellites.",
          disabled: true
        },
        {
          value: "starlink",
          URL: "https://en.wikipedia.org/wiki/Starlink",
          Description:
            "Starlink is a satellite internet constellation operated by SpaceX, providing satellite Internet access coverage to 40 countries. It also aims for global mobile phone service after 2023. SpaceX started launching Starlink satellites in 2019. As of September 2022, Starlink consists of over 3,000 mass-produced small satellites in low Earth orbit (LEO), which communicate with designated ground transceivers. In total, nearly 12,000 satellites are planned to be deployed, with a possible later extension to 42,000. Starlink provides internet access to over 500,000 subscribers as of June 2022."
        },
        {
          value: "adobe",
          URL: "https://en.wikipedia.org/wiki/Adobe_Inc.",
          Description:
            "Adobe Inc., originally called Adobe Systems Incorporated, is an American multinational computer software company incorporated in Delaware and headquartered in San Jose, California. It has historically specialized in software for the creation and publication of a wide range of content, including graphics, photography, illustration, animation, multimedia/video, motion pictures, and print. Its flagship products include Adobe Photoshop image editing software; Adobe Illustrator vector-based illustration software; Adobe Acrobat Reader and the Portable Document Format (PDF); and a host of tools primarily for audio-visual content creation, editing and publishing. Adobe offered a bundled solution of its products named Adobe Creative Suite, which evolved into a subscription software as a service (SaaS) offering named Adobe Creative Cloud. The company also expanded into digital marketing software and in 2021 was considered one of the top global leaders in Customer Experience Management (CXM)."
        }
      ]
    }
  ])
  .then(answers => {
    console.log(answers)
  })
```

### 表格选项

| 密钥 | 类型( 默认) | 说明 |
| --- | --- | --- |
| 名称 | 字符串 | 从提示返回的答案所用的字符串密钥 |
| 下层 | 字符串 | 在表格下方显示的文本 |
| 消息 | 字符串 | 在表格上方显示的文本 |
| 单词 | 布尔 (假) | 设置为是否对表格中的文字 |
| 关闭边界 | 布尔( 真) | 设置为假,如果您不想在字形边界上包裹. |
|  |  | 只有在文字Wrap属实时才适用. |
| 页面大小 | 整数(5) | 每页显示行数 |
| 样式 | 对象 | 见 [https://github.com/cli-table/cli-table3 页面存档备份,存于互联网档案馆](https://github.com/cli-table/cli-table3) 用于应用样式 |
| 曲线 | 阵列<整数> | 每个列的大小 `columns` |
| 栏 | 数组 < column > | 见 [栏](https://npmcn.com/package/%40adobe/inquirer-table-checkbox/#readme-Column) |
| 行数 | 数组 < Row > | 见 [行数](https://npmcn.com/package/%40adobe/inquirer-table-checkbox/#readme-Row) |

### 栏

每个列是带有这些密钥的对象 :

| 密钥 | 类型 | 说明 |
| --- | --- | --- |
| 名称 | 字符串 | 列的密钥(在行中使用) |
| 单词Wrap( 可选) | 布尔 | 如果您想要覆盖表格选项, 设置 |
| 关闭边框( 可选) | 布尔 | 如果您想要覆盖表格选项, 设置 |

### 行数

每个行都是带有这些密钥的对象 :

| 密钥 | 类型 | 说明 |
| --- | --- | --- |
| 价值 | 任意 | 这是如果选中行要返回的值 |
| 已禁用 | 布尔 | 显示选项,但不允许用户选择 |
| _栏名Name_ | 字符串 | 每栏 `name` (见 [栏](https://npmcn.com/package/%40adobe/inquirer-table-checkbox/#readme-Column) (见上文第二节), |
|  |  | 将密钥设置为列 `name` 和该行的列内容值. |

## 常见问题

### @adobe/inquirer-table-checkbox 是什么？

问讯器的复选框提示\( 作为多栏表\)

### 如何安装 @adobe/inquirer-table-checkbox？

在项目目录运行 npm install @adobe/inquirer-table-checkbox，或使用 pnpm add / yarn add / bun add。

### @adobe/inquirer-table-checkbox 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/adobe\_\_inquirer-table-checkbox 是否存在。

### @adobe/inquirer-table-checkbox 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @adobe/inquirer-table-checkbox 需要什么版本的 Node\.js？

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

### @adobe/inquirer-table-checkbox 可以商用吗？

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

### @adobe/inquirer-table-checkbox 的下载量有多少？

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

### @adobe/inquirer-table-checkbox 还在维护吗？

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

