@dimarborda/docx-editor

中文文档
0.19.3发布于 2026/11/11MITTypeScriptES Module近 30 天下载 3417

浏览器的Word (.docx) 编辑器: Rust + WebAssembly 排版引擎为画布所提供,作为框架-不可知的网页组件. 一个AI代理可以在用户继续工作时通过它的API编辑

中文使用文档
文档目录6 节
  1. 安装
  2. 用代码
  3. 特征
  4. 文档
  5. 对于 AI 编码代理
  6. 许可证

@dimarborda/docx编辑器

npm

单词( E).docx) 为浏览器编辑. 一个 Rust 和 Web Assembly 引擎读取了文档,将页面排出像 Word 一样,并应用了毫无损失地编辑. 它与React,Vue,Svelte,Angular或plain HTML一起工作,并在Tauri等桌面应用中工作. 它不需要服务器: 库将文档发送到任何地方 .

对于AI特工, markers() 列出要填入的剩余内容,并通过API进行编辑时会突出显示,而不移动用户的守护.

演示 • 妇女 GitHub 的完整文档 : 联合国 • 妇女 西班牙语Name

安装

npm install @dimarborda/docx-editor
<docx-toolbar for="doc"></docx-toolbar>
<docx-editor id="doc" src="/templates/contract.docx" style="height: 80vh"></docx-editor>

<script type="module">
  import '@dimarborda/docx-editor';          // registers <docx-editor> and <docx-toolbar>
  import '@dimarborda/docx-editor/style.css';
  import '@dimarborda/docx-editor/fonts';    // optional: stand-ins for Calibri, Cambria, Arial…

  const editor = await document.getElementById('doc').whenReady();
  editor.replaceVariables({ CLIENT: 'Acme Inc.', DATE: 'October 7, 2026' });
</script>

容器需要一个高度。 包含类型脚本。 如果你的应用程序发送 Content-Security-Policy,生产 script-src 需求 'wasm-unsafe-eval'。 。 。 .

用代码

import { DocxEditor } from '@dimarborda/docx-editor';
import '@dimarborda/docx-editor/style.css';

const editor = await DocxEditor.create(document.querySelector('#editor'), { locale: 'en' });

await editor.open(file);                       // File, Blob, ArrayBuffer or Uint8Array
editor.replaceVariables({ CLIENT: 'Acme' });   // fills {{CLIENT}}, {CLIENT}…
editor.insertParagraphs(['The parties agree as follows.'], { at: 'end' });
await editor.downloadPdf('contract.pdf');      // vector PDF with selectable text
const bytes = editor.save();                   // Uint8Array of the edited .docx

特征

  • 模板和标记 : 列表并填入 {{KEY}}, (中文(简体) ), {key} 待定 […] 内容,保留格式.
  • 代理活动 : markActivity() 显示代理人的工作位置.
  • 内容 : 段落、表格、图像、文本框、逻辑部分和现有表格,来自代码.
  • 格式化 : 样式、字体、字符格式化、对齐、间隔、缩进和列表,写作Word的方式.
  • 导出 : 无损失 .docx 和带有工作链接的矢量PDF.
  • 视图 : 仅读模式、缩放、水印和可选工具栏.

文档

指南联合国西班牙语Name
API: 每一种方法、选项和事件api 密码api 密码
指南:标记、代理、段落、表格、PDF、图像指南指南
反应, Next.js, Tauri, 字体、样式、捆绑器整合整合
安全和限制警卫警卫

图书馆将您的文档无处发送, 并且从未执行它们的内容 . 报告脆弱性。 。 。 .

对于 AI 编码代理

货船 AGENTS.md:为编码代理撰写的关于API,其惯例和陷阱的紧凑指南. 让你的经纪人在使用软件包的项目中加载,请参考 AGENTS.md 或者说 CLAUDE.md数字 :

@node_modules/@dimarborda/docx-editor/AGENTS.md

两个图书馆的概况也载于 页:1 满分 llms- full.txt (英语)。 。 。 .

许可证

麻省理工学院

版本与发布记录

@dimarborda/docx-editor 共发布 32 个版本,首次发布于 2026/10/08;过去 12 个月发布了 32 个版本。

版本发布日期距今
0.19.3latest2026/11/111 天前
0.19.22026/11/047 天前
0.19.12026/11/047 天前
0.19.02026/11/048 天前
0.18.02026/11/038 天前
0.17.32026/10/2716 天前

关于 @dimarborda/docx-editor 的常见问题

@dimarborda/docx-editor 是什么?

浏览器的Word (.docx) 编辑器: Rust + WebAssembly 排版引擎为画布所提供,作为框架-不可知的网页组件. 一个AI代理可以在用户继续工作时通过它的API编辑

如何安装 @dimarborda/docx-editor?

在项目目录运行 npm install @dimarborda/docx-editor,或使用 pnpm add / yarn add / bun add。

@dimarborda/docx-editor 支持 TypeScript 吗?

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

@dimarborda/docx-editor 支持 ESM 还是 CommonJS?

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

@dimarborda/docx-editor 可以商用吗?

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

@dimarborda/docx-editor 的下载量有多少?

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

@dimarborda/docx-editor 还在维护吗?

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