Getting Started
Introduction
Overview of the office-open project and its packages
office-open is a TypeScript monorepo for generating Office Open XML documents. It provides declarative APIs to create .docx, .pptx, and .xlsx files without needing Microsoft Office installed.
Monorepo Structure
The project is organized into four packages, each with a focused responsibility:
@office-open/core
The foundational shared package. Provides:
- Common XML components used across document types
- Value validation utilities
- OOXML formatting helpers
- Unit converters (e.g., EMU, points, twips)
You typically don't install this package directly — it's a dependency of the document-specific packages.
@office-open/xml
XML parsing and serialization layer:
- Converts XML strings to JSON-compatible object trees
- Serializes object trees back to XML strings
- Handles OOXML-specific XML conventions (namespaces, prefixes)
@office-open/docx
Word document generation:
- Create
.docxfiles with paragraphs, tables, images, headers, footers, and more - Support for styles, sections, page layout, and numbering
- Export to
Buffer(Node.js) orBlob(browser)
@office-open/pptx
PowerPoint presentation generation:
- Create
.pptxfiles with slides, shapes, images, and charts - Support for slide layouts, masters, and transitions
- Export to
Buffer(Node.js) orBlob(browser)
How It Works
- You describe your document using the declarative API (e.g.,
new Document(...),new Paragraph(...)) - Each element maps to an XML component that produces valid OOXML markup
- The
Packerserializes all components into an Office Open XML package (ZIP archive) - You receive a
BufferorBlobready to save or serve