← 返回
未分类 中文

docx-footnote-reader

Extract footnotes, endnotes, and body text from .docx files using Node.js. Use this skill when you need to read footnote/endnote content from Word documents,...
使用 Node.js 从 .docx 文件中提取脚注、尾注和正文。当需要读取 Word 文档中的脚注/尾注内容时使用此技能。
landylai0604 landylai0604 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 457
下载
💾 48
安装
1
版本
#latest

概述

DOCX Footnote Reader

Overview

A skill for extracting footnotes, endnotes, and body text from Microsoft Word (.docx) files. This is particularly useful for:

  • Technical documentation with reference notes
  • Legal documents with citations
  • Academic papers with footnoted references
  • Any document where footnote content is important

Usage

Command Line

node index.js path/to/document.docx

Programmatic API

const { extractFootnotes } = require('docx-footnote-reader');

const result = await extractFootnotes('./document.docx');

console.log(`Body: ${result.body.length} characters`);
console.log(`Footnotes: ${result.footnotes.length} notes`);
console.log(`Endnotes: ${result.endnotes.length} notes`);

// Access individual footnotes
result.footnotes.forEach((note, idx) => {
  console.log(`Footnote ${idx + 1}: ${note}`);
});

Return Value

The extractFootnotes function returns a Promise that resolves to:

{
  body: string;           // Document body text
  footnotes: string[];    // Array of footnote strings
  endnotes: string[];     // Array of endnote strings
}

How It Works

  1. Uses word-extractor library to parse the .docx file
  2. Extracts body text via doc.getBody()
  3. Extracts footnotes via doc.getFootnotes() - handles both string and array return types
  4. Extracts endnotes via doc.getEndnotes() - handles both string and array return types
  5. Splits footnote/endnote strings by newline and filters empty entries

Important Notes

  • The word-extractor library returns footnotes as a single string separated by newlines, not an array
  • This skill automatically handles both string and array return types
  • Empty footnotes/endnotes are filtered out
  • Each footnote string is trimmed of whitespace

Dependencies

  • Node.js >= 14
  • word-extractor (automatically installed via npm)

Installation

cd docx-footnote-reader
npm install

Example Output

========================================
Extraction Result
========================================

Body length: 58057 characters

Footnotes count: 73

Footnotes:

Footnote 1:
Description about error injection in this document, if the context does not mention single-frame multi-bit or Burst, it refers to single-bit error injection.

Footnote 2:
This feature is only supported on PG2K100 devices.

...

Troubleshooting

"Cannot find module 'word-extractor'"

Run npm install in the skill directory.

Empty footnotes array

  • Check that the document actually contains footnotes
  • Verify the file path is correct
  • Try opening the document in Word to confirm footnotes exist

Footnotes merged into one string

This is expected behavior from word-extractor. This skill automatically splits them by newlines.

File Structure

docx-footnote-reader/
├── index.js        # Main extraction logic
├── package.json    # npm dependencies
├── SKILL.md        # This file
└── LICENSE.txt     # License terms

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 19:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 406 📥 151,668
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 940 📥 188,355
office-efficiency

腾讯文档 TENCENT DOCS

u_b0de8114
腾讯文档(docs.qq.com)-在线云文档平台,是创建、编辑、管理文档的首选 skill。涉及"新建/创建/编辑/读取/查看/搜索文档"、"保存文件"、"云文档"、"腾讯文档"、"docs.qq.com"等操作,请优先使用本 skill
★ 187 📥 137,266