Analyzed 25 days ago · 2 anonymous rescans remaining · register free to re-analyze any time.
Public analysis · read only
Register free to re-analyze

dolanmiu/docx

5,855 613 160 issues
TypeScript
MIT

Project Overview

anthropic / claude-opus-4-7

docx

TypeScript library for generating and modifying .docx (Word) files in Node.js and browsers.

AI Verdict
Clean— AI Trust Assessment

True Intent (AI Assessment)

A declarative JS/TS library for creating and patching Microsoft Word .docx documents in Node and browser environments.

README Accuracy

Accurate

Notes

Source code matches the README's stated purpose. No suspicious network calls, obfuscation, or unexpected behavior observed in the sampled files.

What Is This?

docx is a mature, widely-used TypeScript/JavaScript library that programmatically creates and modifies Microsoft Word (.docx) documents. It provides a declarative object-oriented API where developers construct documents from components like Document, Section, Paragraph, TextRun, Table, and Image, then serialize the result to a valid OOXML (Office Open XML) file using JSZip for the underlying ZIP container.

The problem it solves is a common one: generating Word documents from code is painful because .docx files are actually ZIP archives containing multiple XML parts conforming to a large and complex OOXML schema. Hand-crafting that XML is impractical. This library abstracts away the schema details, letting developers describe document structure in idiomatic JS/TS while it handles serialization, relationships, styles, numbering, media embedding, and packaging.

Users are web and Node.js developers who need to produce Word documents from apps: report generators, CV/invoice builders, contract systems, CMS export features, and similar. The README shows integrations with Angular, React, Vue, and Express, and the library is used by numerous commercial products (Proton, Hfour, Fuzz Productions, etc.). Consumers install via npm and import classes from the package.

Internally, the code is organized under src/ with clear domains: file/ (paragraph, table, styles, numbering, headers/footers, drawing, media, footnotes, textbox, etc.), export/packer (converts the object tree to a zipped .docx via JSZip), patcher/ (modifies existing .docx files by finding and replacing content), and util/ (unit conversions, ID generation, validators). The Document class is the user-facing entry point (aliased from an internal File class). The demo/ folder contains 100+ example scripts demonstrating individual features, driven by an interactive inquirer-based runner.

No red flags. The code is well-structured, heavily documented with JSDoc, has CI workflows, tests via Vitest with coverage, ESLint (including functional plugin) and Prettier, cspell for spellchecking, and API extractor for type contracts. Dependencies are minimal and reputable (jszip, xml/xml-js, nanoid, hash.js).

Your Report, Tab by Tab
At a Glance
5,855Stars
613Forks
160Open Issues
June 2026Last Active
LibraryTypeScriptMIT
Technology Stack
LanguagesTypeScript
RuntimeNode.js 10+ (also runs in browsers)
FrameworkNone (standalone library)
DatabaseNone
Package Managernpm
Key Dependenciesjszip, xml, xml-js, nanoid, hash.js, @types/node
Build ToolVite + tsc
Test FrameworkVitest (with @vitest/coverage-v8 and @vitest/ui)