@bunizao/contracts

中文文档
0.28.0发布于 2026/11/02UNLICENSEDTypeScriptES Module零依赖近 30 天下载 2910

Shared TypeScript contracts for buxx.me services and clients.

原始使用文档

@bunizao/contracts

Shared TypeScript contracts used by the buxx.me site and API Worker.

The package is published from packages/contracts in the bunizao/site repository. Consumers should depend on an exact version so the public site and private API Worker upgrade the contract deliberately together.

bun add @bunizao/[email protected]
# or
npm install @bunizao/[email protected]

The package exports the complete contract from @bunizao/contracts and the feature modules from @bunizao/contracts/{analytics,admin,content,listening,mood,notify,routes,telegram-ops}.

@bunizao/contracts/runtime is the one subpath that ships code rather than types: the env readers (createEnvReaders, readRuntimeValue, setRuntimeEnvSource), the JSON response helpers and the query parsers both Workers run. Bind the env readers to the bundle's own import.meta.env once, in a local module, since bundlers only replace it in application source.

The package is source-available but not licensed for redistribution. See LICENSE for the applicable terms.

版本与发布记录

@bunizao/contracts 共发布 28 个版本,首次发布于 2026/08/29;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.28.0latest2026/11/026 天前
0.27.02026/11/027 天前
0.26.02026/11/017 天前
0.24.02026/10/2910 天前
0.23.02026/10/2613 天前
0.22.02026/10/2613 天前

关于 @bunizao/contracts 的常见问题

@bunizao/contracts 是什么?

Shared TypeScript contracts for buxx.me services and clients.

如何安装 @bunizao/contracts?

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

@bunizao/contracts 支持 TypeScript 吗?

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

@bunizao/contracts 支持 ESM 还是 CommonJS?

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

@bunizao/contracts 可以商用吗?

@bunizao/contracts 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@bunizao/contracts 的下载量有多少?

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

@bunizao/contracts 还在维护吗?

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