@asyncapi/generator

中文文档
3.5.0发布于 2026/10/20Apache-2.0CommonJS构建来源已验证近 30 天下载 59.4万

The AsyncAPI generator. It can generate documentation, code, anything!

原始使用文档

Generator is a tool that you can use to generate whatever you want basing on the AsyncAPI specification file as an input. For more information read the docs.

There is a large number of templates that are ready to use and are officially supported by the AsyncAPI Initiative.

List of official generator templates

Template NameDescriptionSource code
@asyncapi/nodejs-template(archived) Generates Nodejs service that uses Hermes packageclick here
@asyncapi/nodejs-ws-template(archived) Generates Nodejs service that supports WebSockets protocol onlyclick here
@asyncapi/java-templateGenerates Java JMS applicationclick here
@asyncapi/java-spring-template(archived) Generates Java Spring serviceclick here
@asyncapi/java-spring-cloud-stream-templateGenerates Java Spring Cloud Stream serviceclick here
@asyncapi/python-paho-template(archived) Generates Python service that uses Paho libraryclick here
@asyncapi/html-templateGenerates HTML documentation siteclick here
@asyncapi/markdown-templateGenerates documentation in Markdown fileclick here
@asyncapi/ts-nats-template(archived) Generates TypeScript NATS clientclick here
@asyncapi/go-watermill-template(archived) Generates Go client using Watermillclick here
@asyncapi/dotnet-nats-template(archived) Generates .NET C# client using NATSclick here
@asyncapi/php-template(archived) Generates PHP client using RabbitMQclick here
@asyncapi/dotnet-rabbitmq-template(archived) Generates .NET C# client using RabbitMQclick here

[!NOTE] Templates marked (archived) live in the asyncapi-archived-repos organization and are no longer maintained. Consider the baked-in templates for supported alternatives.

You can find above templates and the ones provided by the community in this list

[!IMPORTANT] Experimental Feature: AsyncAPI Generator also comes with baked-in templates - official templates shipped directly inside the Generator (@asyncapi/generator). They cover code, docs, configs, and SDKs, and are maintained under /packages/templates directory, following a strict, opinionated structure for consistency and ease of maintenance. This feature is not recommended for production use. For those who want to try them out or learn more, see the Baked-in templates documentation.

版本与发布记录

@asyncapi/generator 共发布 237 个版本,首次发布于 2020/03/19;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.5.0latest2026/10/2018 天前
3.4.12026/09/171 个月前
3.4.02026/08/053 个月前
3.3.12026/07/143 个月前
3.3.02026/06/184 个月前
3.2.32026/06/184 个月前

关于 @asyncapi/generator 的常见问题

@asyncapi/generator 是什么?

The AsyncAPI generator. It can generate documentation, code, anything!

如何安装 @asyncapi/generator?

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

@asyncapi/generator 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/asyncapi__generator 是否存在。

@asyncapi/generator 支持 ESM 还是 CommonJS?

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

@asyncapi/generator 需要什么版本的 Node.js?

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

@asyncapi/generator 可以商用吗?

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

@asyncapi/generator 的下载量有多少?

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

@asyncapi/generator 还在维护吗?

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