@usejunior/docx-core
v0.20.1
Published
OOXML (.docx) core library: primitives, document generation, and track changes
Maintainers
Readme
@usejunior/docx-core
OOXML primitives and DOCX generation in TypeScript.
Install
npm install @usejunior/docx-coreExample
import { writeFile } from 'node:fs/promises';
import { generateDocx } from '@usejunior/docx-core';
const document = await generateDocx({
sections: [{
blocks: [{
kind: 'paragraph',
runs: [{ kind: 'text', text: 'Hello' }],
}],
}],
});
await writeFile('hello.docx', document);DocumentSpec supports sections, headers and footers, fields, styles, tables, numbering, and comments. The supported runtime uses jszip and @xmldom/xmldom; it does not require Word, LibreOffice, Python, or .NET.
For two-document comparison, use @usejunior/docx-compare. For agent-driven editing, use @usejunior/safe-docx.
See the repository architecture, support contract, and package source and examples.
