@bobcao3/cpi-tree-sitter-wasm

中文文档
0.0.7发布于 2026/10/26MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2335

Reusable parsing and highlighting with bundled grammars, independent of Pi.

原始使用文档

Tree-sitter WASM

Reusable parsing and highlighting with bundled grammars, independent of Pi.

The source workspace exports TypeScript directly for editable Bun development. Use the package's native build script when changing Zig or grammar inputs; its compiler and dependency pins live in build.zig.zon.

To prepare a publishable package, run scripts/package.mjs with a signed WASM file and a new output directory. It emits JavaScript, declarations, and a tarball containing the verified asset and licenses. Publish the prepared tarball, not the private source workspace. The release workflow's npm publication input is explicitly opt-in.

Import parsing and highlighting from @bobcao3/cpi-tree-sitter-wasm; the source workspace uses the @cpi/tree-sitter-wasm alias. Asset selection and trusted local-build overrides are defined in resolve.ts. There is no runtime network provisioning or install-time build.

artifact.test.mjs uses npm and Bun to install real tarballs into isolated consumers, then exercises parsing, highlighting, signature rejection, and missing asset errors. Set CPI_TREE_SITTER_TEST_ARTIFACT to a directory containing the signed WASM input. The compiler smoke test is scripts/tree-sitter-wasm.integration.mjs.

License provenance accompanies the package in licenses.

版本与发布记录

@bobcao3/cpi-tree-sitter-wasm 共发布 8 个版本,首次发布于 2026/10/06;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.7latest2026/10/2613 天前
0.0.62026/10/2613 天前
0.0.52026/10/1623 天前
0.0.42026/10/1325 天前
0.0.32026/10/1029 天前
0.0.22026/10/0930 天前

关于 @bobcao3/cpi-tree-sitter-wasm 的常见问题

@bobcao3/cpi-tree-sitter-wasm 是什么?

Reusable parsing and highlighting with bundled grammars, independent of Pi.

如何安装 @bobcao3/cpi-tree-sitter-wasm?

在项目目录运行 npm install @bobcao3/cpi-tree-sitter-wasm,或使用 pnpm add / yarn add / bun add。

@bobcao3/cpi-tree-sitter-wasm 支持 TypeScript 吗?

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

@bobcao3/cpi-tree-sitter-wasm 支持 ESM 还是 CommonJS?

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

@bobcao3/cpi-tree-sitter-wasm 可以商用吗?

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

@bobcao3/cpi-tree-sitter-wasm 的下载量有多少?

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

@bobcao3/cpi-tree-sitter-wasm 还在维护吗?

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