@erickzhao/electron-versions

中文文档
4.1.0发布于 2025/07/26MITTypeScriptES Module近 30 天下载 9520

Get Electron and Chromium versions for tags in a given directory

原始使用文档
文档目录3 节
  1. Usage
  2. Usage as a module
  3. License

electron-versions

Check a repository for tags and list the Electron & Chromium versions referenced in the package.json files of those tags.

🍄  ➜  ~/Desktop  electron-versions ~/Code/slack-desktop -f="<9.0.0"
Tag 4.10.0  Electron 10.1.2         Chromium 85.0.4183.98
Tag 4.9.1   Electron 10.1.1         Chromium 85.0.4183.93
Tag 4.9.0   Electron 10.1.0         Chromium 85.0.4183.87
Tag 4.8.0   Electron 9.0.5          Chromium 83.0.4103.119
Tag 4.7.0   Electron 9.0.5          Chromium 83.0.4103.119
Tag 4.6.0   Electron 8.2.5          Chromium 80.0.3987.165
Tag 4.5.1   Electron 8.2.5          Chromium 80.0.3987.165
Tag 4.5.0   Electron 8.2.2          Chromium 80.0.3987.163
Tag 4.4.9   Electron 9.0.0-beta.24  Chromium 83.0.4103.45
Tag 4.4.3   Electron 7.2.4          Chromium 78.0.3904.130

Usage

  • -f | --filter: A semver-range used to filter the tags tested
  • -l | --length: How many tags to check (default: 10)
  • --write-markdown: Write the results to a markdown file
  • --write-json: Write the results to a json file (will speed up future runs)
  • --json: Print the result as JSON
  • --defaultBranch: Default branch to read from (default: origin/master)

Usage as a module

This module is synchronous. It could be async, but since using this anywhere outside of cli tools seems silly, I didn't bother implementing an async version.

const { getVersions } = require('electron-versions')

const options = {
  cwd: '/path/to/the/repo',
  filter: '>4.0.0',         // Undefined for no filter
  length: 10                // Undefined for no limit
  onProgress: (done, left, total) => {}
}

const versions = getVersions(options);

License

MIT

版本与发布记录

@erickzhao/electron-versions 共发布 3 个版本,首次发布于 2025/03/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.1.0latest2025/07/261.3 年前
4.0.12025/04/021.6 年前
4.0.02025/03/281.6 年前

关于 @erickzhao/electron-versions 的常见问题

@erickzhao/electron-versions 是什么?

Get Electron and Chromium versions for tags in a given directory

如何安装 @erickzhao/electron-versions?

在项目目录运行 npm install @erickzhao/electron-versions,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 electron-versions,可以用 npx electron-versions 直接运行。

@erickzhao/electron-versions 支持 TypeScript 吗?

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

@erickzhao/electron-versions 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@erickzhao/electron-versions 需要什么版本的 Node.js?

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

@erickzhao/electron-versions 可以商用吗?

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

@erickzhao/electron-versions 的下载量有多少?

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

@erickzhao/electron-versions 还在维护吗?

最新版本 4.1.0 发布于 2025/07/26(1.3 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/03/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。