officeParser

Parse Office documents into a rich AST and generate Markdown, HTML, PDF, or RAG chunks

Library
npm
v8.0.0
551 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
79 /100 Good
Development Activity 92
Maintenance 84
Community 52
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 80
Code Quality 82
Innovation 78
Learning Curve 72

officeParser is a strictly-typed Node.js and browser library that parses office documents — docx, pptx, xlsx, odt, odp, ods, pdf, rtf, csv, md, html, and epub — into a rich, hierarchical Abstract Syntax Tree rather than a flat text blob. That AST preserves structure (headings, tables, notes, formatting, attachments) so downstream code can reason about document layout, not just extract raw text.

From the same AST, the library’s generator layer can re-render the document into Markdown, HTML, CSV, RTF, PDF, EPUB, plain text, or pre-segmented RAG chunks, and an OfficeConverter wraps parse+generate into a single one-step conversion call. It ships both as a programmatic API (OfficeParser.parseOffice(), ast.to()) and a CLI (npx officeparser), with optional OCR via Tesseract for scanned/image content.

What You Get

  • A unified parseOffice() API producing a hierarchical AST across 12 input formats (docx, pptx, xlsx, odt, odp, ods, pdf, rtf, csv, md, html, epub)
  • An OfficeGenerator/ast.to() layer that renders the same AST into Markdown, HTML, CSV, RTF, PDF, EPUB, plain text, or RAG chunks
  • A one-step OfficeConverter.convert() API that parses and generates in a single call
  • Native RAG chunking output tailored for retrieval pipelines, with configurable chunk sizing
  • Optional OCR (via Tesseract) for scanned images and image-embedded content, with granular timeout controls
  • AbortSignal-based cancellation and non-fatal warning collection (ast.warnings) instead of hard failures on recoverable issues
  • Both a Node.js/browser library API and a full-featured CLI (npx officeparser)

Common Use Cases

  • Extracting clean, structured text and metadata from user-uploaded Word/PDF/PowerPoint files for search indexing
  • Building RAG ingestion pipelines that need pre-chunked, structure-aware text from office documents
  • Converting legacy .docx/.odt reports into Markdown or HTML for a documentation or CMS pipeline
  • Batch-converting office files to PDF or EPUB from a CLI script or CI job
  • Extracting text and images (with OCR) from scanned PDFs where no text layer exists

Under The Hood

Architecture: The library separates parsing from generation: src/parsers/ holds one dedicated parser per format (WordParser, PowerPointParser, ExcelParser, PdfParser, RtfParser, OpenOfficeParser, CsvParser, MarkdownParser, HtmlParser, EpubParser), each producing a common AST node shape defined in the ~2,100-line types.ts; OfficeParser.ts dispatches to the right parser and returns the AST, while OfficeGenerator.ts and the format-specific files under src/generators/ walk that same AST to emit Markdown/HTML/CSV/RTF/PDF/EPUB/chunks, and OfficeConverter.ts composes the two into a single parse-then-generate call. Tech Stack: TypeScript compiled to dual CJS/ESM output plus a separate browser bundle (officeparser.browser.mjs/.iife.js) built via a custom build_browser.js script, with Tesseract.js for OCR and pdf.js for PDF parsing as the two heaviest runtime dependencies, versions kept in sync via a sync:pdfjs-versions script. Code Quality: The test suite is unusually broad for an npm library — dedicated suites for parser correctness, generator output, CLI behavior, security, licensing, exhaustive format coverage, and roundtrip/performance analysis (test/testExhaustive.ts, test/roundtrip_analysis.ts, test/performance_test.ts), all gated behind a test script that also runs lint and a full build first, indicating CI enforces both correctness and packaging integrity. API Design: The library favors explicit, discoverable entry points — parseOffice() for extraction, ast.to() for AST-native conversion, and OfficeConverter.convert() as a one-step shortcut — while surfacing non-fatal issues via ast.warnings instead of throwing, and documents every CLI flag (including deprecated aliases) in a single reference table, which keeps the migration path visible across major versions.

Used by 8 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 6 days ago
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants · AI Memory

4,966

A portable memory layer for AI coding agents — curate structured project knowledge into a version-controlled context tree that syncs across tools, machines, and teammates.

View details
50
Repo Health
83
Technical
70
Dependency
Built with
TypeScript 99%
Updated 3 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
62%
Other

Flowise

AI Development · Automation · Developer Tools

55,490

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
82
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 62%
JavaScript 27%
Updated 1 months ago
TypeScript
99%
Other

LobeHub

AI Assistants · Automation · Productivity

82,864

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

15,042

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
53
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 96%
Updated 3 months ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,377

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers