@eventcatalog/exporters

中文文档
0.1.5发布于 2026/11/10MITTypeScriptESM + CJS构建来源已验证近 30 天下载 6758

导出一个事件Catalog 到其它格式, 如单文件 HTML 架构引用

中文使用文档
文档目录4 节
  1. 你可能不需要这个包裹
  2. 自定义导出: 团队外人员的目录部分
  3. 使用软件包
  4. 许可证

@ eventcatalog/ 输出者

导出 a 事件目录 改为其他格式.

它输出 结构参考: 您的完整目录作为一个自成一体的 HTML 文件, 您可以在任何地方共享、 附加或主机 。 每个域,系统,服务,消息,信道,数据存储,流量,实体和团队都会获得自己的部分,与它相关的一切相关联,并带有来自您计划(JSON Schema, Avro and Protobuf)的信息属性,实例有效载荷,TypeScript类型以及您的规格.

你可能不需要这个包裹

  • eventcatalog build 写入 architecture.html 输入每个建筑的建材输出。 关掉 eventcatalog.config.js数字 :

    export default {
      exports: {
        html: { enabled: false },
      },
    };
    
  • 国家行动倡议 按需导出并在浏览器中打开:

    npx @eventcatalog/cli export --format html --output architecture.html
    

自定义导出: 团队外人员的目录部分

自定义导出是您为合伙人、 公众或监管者选择的目录的一部分, 作为文件写入其中 exports/它的前题是它里面的东西; 它的身体是介绍读者先看的.

---
# exports/partner-payments.mdx
title: Payments for partners
summary: How partners take payment for orders.
audience: Partners integrating with Acme Checkout
version: 2026.10
include:
  - system: payment-processing-system # a domain or system brings what's in it
  - service: checkout-api
    version: 1.x
  - event: payment-succeeded
  - x-public: true # every resource with this custom property (x- in its frontmatter)
    kind: [service, event] # optional: only these kinds
exclude:
  - service: payment-worker # wins over include, and brings nothing with it
  - x-data-classification: [confidential, restricted] # any of these values
references: omit # pointers at anything not in the export: omit, name-only or include (one level)
hide: [owners, repository, contacts, docs] # the default
---

Welcome! This guide covers everything you need to take payment for an Acme order.
  • eventcatalog build 每个自定义导出到 exports/<id>.html 在构建输出中( 带有认证, 仅在 exports.custom.enabled 实值 true) (中文(简体) ). 有问题的文件会被警告跳过,其他文件仍然被写入.
  • npx @eventcatalog/cli export partner-payments 写入; 添加 --check 列出里面的东西 被遗漏的东西和原因 而不写. --check 当导出名称不在目录中时失败, CI 通知重命名 .
  • exports.custom 内 eventcatalog.config.js 套装 defaults (单位:千美元)hide, (中文(简体) ), references每一次自定义出口, only 来建造其中的一部分, dir 用于文件夹,以及 neverExport 用于任何自定义的输出,无论它包括什么.

选择者命名一个资源( S)service: checkout-api,带有可选 version)或匹配自定义属性(x-public: true) (中文(简体) ). 在属性选择器中 x- 字段必须匹配; 当资源值是给定的值之一时, 字段匹配( 作为文本比较, 所以) true 匹配 "true"),并在资源前题中的列表中与其任何项目匹配。 一个匹配的域或系统带来了里面的东西,就像一个由id命名的. 自定义属性本身从不输出.

资源被取出 exclude 或者说 neverExport 从未命名 : 投放指针, 并在 docs 中将其链接改为“ 另一种服务 ”.

使用软件包

import { renderHtml, writeHtml, loadCatalog, renderCustomExports, formatCustomExportReport } from '@eventcatalog/exporters';

// Render the reference as a string
const { html } = await renderHtml('/path/to/catalog');

// Or write it to a file
const { path, bytes, durationMs } = await writeHtml({ dir: '/path/to/catalog', outputPath: 'architecture.html' });

// Or load the catalog into one resolved model (relationships, schemas, owners) to build your own export
const model = await loadCatalog('/path/to/catalog');

// The custom exports in exports/: rendered, with a report of what's in each and what was left out.
// Each stands alone: one that can't be exported is in `failed`, with its error, and the rest are still rendered.
const { rendered, failed } = await renderCustomExports('/path/to/catalog');
console.log(formatCustomExportReport(rendered[0].report));

许可证

麻省理工学院

版本与发布记录

@eventcatalog/exporters 共发布 10 个版本,首次发布于 2026/10/15;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.5latest2026/11/103 天前
0.1.42026/10/2618 天前
0.1.32026/10/2321 天前
0.1.22026/10/1925 天前
0.1.12026/10/1628 天前
0.1.02026/10/1628 天前

关于 @eventcatalog/exporters 的常见问题

@eventcatalog/exporters 是什么?

导出一个事件Catalog 到其它格式, 如单文件 HTML 架构引用

如何安装 @eventcatalog/exporters?

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

@eventcatalog/exporters 支持 TypeScript 吗?

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

@eventcatalog/exporters 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@eventcatalog/exporters 可以商用吗?

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

@eventcatalog/exporters 的下载量有多少?

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

@eventcatalog/exporters 还在维护吗?

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