# @capacitor-community/electron 中文文档

规范地址：https://npmcn.com/package/%40capacitor-community/electron/

版本：5\.0\.1
npm 元数据更新时间：2026-10-23T21:47:48.982Z
中文译文更新时间：2026-11-09T03:11:36.415Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：514 kB，14 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：10 个
- 首次发布：2020-06-19T14:42:53.046Z
- 最新版本发布：2023-09-21T15:51:00.593Z
- 近 30 天下载量：57695（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：98（近 12 个月 0 个）

## 中文简介

电能社区支持电能平台!!

## 安装

```sh
npm install @capacitor-community/electron
```

也可以使用：`pnpm add @capacitor-community/electron`、`yarn add @capacitor-community/electron`、`bun add @capacitor-community/electron`

## README

![](https://user-images.githubusercontent.com/20338451/124627505-9cd53a80-de4d-11eb-8d74-f81685804b05.png)  

用 Electron 将您的 Capacitor QQ 应用程序带入桌面

[![](https://img.shields.io/badge/maintenance%20status-maintained-yellow)](https://github.com/capacitor-community/electron) [![](https://img.shields.io/badge/all%20contributors-11-orange?style=flat-square)](https://npmcn.com/package/%40capacitor-community/electron/#readme-contributors) [![](https://img.shields.io/badge/supported%20electron%20version-%5E26.2.0-blue)](https://www.electronjs.org/releases/stable?version=26)

[![](https://img.shields.io/npm/v/@capacitor-community/electron.svg)](https://npmjs.com/package/@capacitor-community/electron) [![npm](https://img.shields.io/npm/dw/@capacitor-community/electron)](https://npmjs.com/package/@capacitor-community/electron) [![](https://img.shields.io/npm/l/@capacitor-community/electron.svg?color=blue)](https://npmjs.com/package/@capacitor-community/electron) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/capacitor-community/electron/ci.yml?branch=main)](https://github.com/capacitor-community/electron)

## QQ 第4版或以上信息

-   您需要版本 `5.4.0`\+ 电容器.
-   模板和内部工作已经发生了很大变化,将完成一个迁移指南,但现在在迁移主要项目之前创建一个新项目来做工匠是一个好主意.
-   以往版本的插件 `@capacitor-community/electron` 将不会在 V4 或以上运行, 但是所有的网络插件将继续正常运行 .
-   V4 和后来在框外没有插件. 相反,V4 及以后和上面都跟随 Capacitor 在被分隔的插件中,参见 [插件示例目录](https://github.com/capacitor-community/electron/tree/main/plugin-examples) 用于实例.

## \* 文档:

[您可以在这里找到文件网站.](https://capacitor-community.github.io/electron/)

## • 警卫

虽然这个平台努力与目前的安全做法保持一致,但有些事情不属于这一平台的控制范围。 请花时间读读 [安全检查清单](https://www.electronjs.org/docs/tutorial/security#checklist-security-recommendations) 电子团队已经创建了 您的应用尽可能安全可靠.

## ++ 维护者

| 维护者 | GitHub 图像 | 社会 | 赞助公司 | 小学 |
| --- | --- | --- | --- | --- |
| 迈克·萨默费尔特 | [信息技术](https://github.com/IT-MikeS) | [@IT 迈克斯](https://twitter.com/IT_MikeS) | 志愿人员 | 对 |

## • 贡献者

<table><tbody><tr><td align="center"><a href="http://ionicframework.com/" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars3.githubusercontent.com/u/11214?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>马克斯·林奇</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=mlynch" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/capacitor-community/electron/commits?author=mlynch" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://github.com/IT-MikeS" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars0.githubusercontent.com/u/20338451?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>迈克·萨默费尔特</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=IT-MikeS" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/capacitor-community/electron/commits?author=IT-MikeS" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://github.com/danielsogl" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars2.githubusercontent.com/u/15234844?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>丹尼尔·索格</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=danielsogl" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/vevedh" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars1.githubusercontent.com/u/1430389?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>埃尔韦·德查维格尼</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=vevedh" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/capacitor-community/electron/commits?author=vevedh" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="http://twitter.com/leMaikOfficial" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars2.githubusercontent.com/u/5544859?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>迈克·马施纳</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=leMaik" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/stewones" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars1.githubusercontent.com/u/719763?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>缝</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=stewones" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/coreyjv" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars3.githubusercontent.com/u/2730750?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>科里·韦兰库尔</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=coreyjv" title="Code" rel="nofollow noopener noreferrer">💻</a></td></tr><tr><td align="center"><a href="https://github.com/jgoux" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars0.githubusercontent.com/u/1443499?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>朱琳·古克</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=jgoux" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/MathisTLD" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/42317770?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>马西斯TLD</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=MathisTLD" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/challenger71498" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/43464986?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>挑战者71498</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=challenger71498" title="Code" rel="nofollow noopener noreferrer">💻</a></td><td align="center"><a href="https://github.com/jdgjsag67251" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/88368191?v=4?s=75" width="75px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>(日语)</b></sub></a><br><a href="https://github.com/capacitor-community/electron/commits?author=jdgjsag67251" title="Code" rel="nofollow noopener noreferrer">💻</a></td></tr></tbody></table>

## 常见问题

### @capacitor-community/electron 是什么？

电能社区支持电能平台\!\!

### 如何安装 @capacitor-community/electron？

在项目目录运行 npm install @capacitor-community/electron，或使用 pnpm add / yarn add / bun add。

### @capacitor-community/electron 支持 TypeScript 吗？

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

### @capacitor-community/electron 支持 ESM 还是 CommonJS？

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

### @capacitor-community/electron 可以商用吗？

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

### @capacitor-community/electron 的下载量有多少？

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

### @capacitor-community/electron 还在维护吗？

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

