@bubblewrap/core

中文文档
1.27.0发布于 2026/10/10Apache-2.0TypeScriptCommonJS近 30 天下载 8万

Core Library to generate, build and sign TWA projects

原始使用文档
文档目录8 节
  1. Requirements
  2. Setting up the Environment
  3. Get the Java Development Kit (JDK) 8.
  4. Get the Android command line tools
  5. Using @bubblewrap/core in a NodeJs project
  6. Contributing
  7. License
  8. Disclaimer

Bubblewrap Core

Node CI Status

Bubblewrap Core is a NodeJS library that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWA) using a Trusted Web Activity (TWA).

Requirements

Setting up the Environment

Get the Java Development Kit (JDK) 8.

The Android Command line tools requires the correct version of the JDK to run. To prevent version conflicts with a JDK version that is already installed, Bubblewrap uses a JDK that can unzipped in a separate folder.

Download a version of JDK 8 that is compatible with your OS from AdoptOpenJDK and extract it in its own folder.

Warning: Using a version lower than 8 will make it impossible to compile the project and higher versions are incompatible with the Android command line tools.

Get the Android command line tools

Download a version of Android command line tools that is compatible with your OS from https://developer.android.com/studio#command-tools. Create a folder and extract the downloaded file into it.

Using @bubblewrap/core in a NodeJs project

npm i -g @bubblewrap/core

Contributing

See CONTRIBUTING for more.

License

See LICENSE for more.

Disclaimer

This is not a Google product.

版本与发布记录

@bubblewrap/core 共发布 70 个版本,首次发布于 2020/03/11;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.27.0latest2026/10/1030 天前
1.25.02026/07/313 个月前
1.24.12025/09/291.1 年前
1.24.02025/09/251.1 年前
1.23.02025/06/251.4 年前
1.22.72025/06/161.4 年前

其他发布通道:canary → 1.14.0-alpha.3。

关于 @bubblewrap/core 的常见问题

@bubblewrap/core 是什么?

Core Library to generate, build and sign TWA projects

如何安装 @bubblewrap/core?

在项目目录运行 npm install @bubblewrap/core,或使用 pnpm add / yarn add / bun add。

@bubblewrap/core 支持 TypeScript 吗?

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

@bubblewrap/core 支持 ESM 还是 CommonJS?

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

@bubblewrap/core 需要什么版本的 Node.js?

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

@bubblewrap/core 可以商用吗?

@bubblewrap/core 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bubblewrap/core 的下载量有多少?

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

@bubblewrap/core 还在维护吗?

最新版本 1.27.0 发布于 2026/10/10(30 天前);至今共发布 70 个版本,其中过去 12 个月发布了 2 个;首次发布于 2020/03/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。