officeParser

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

Library
npm
v7.8.0
526stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
76/100Good
Development Activity100
Maintenance72
Community44
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture80
Code Quality82
Innovation78
Learning Curve72

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

32,102

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
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

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

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants

4,941

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
77
Repo Health
83
Technical
71
Dependency
Built with
TypeScript99%
Updated 1 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

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

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

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

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
TypeScript
99%
Other

LobeHub

AI Assistants · Productivity · Automation

81,816

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
72
Dependency
Built with
TypeScript99%
Updated today
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

14,770

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

View details
56
Repo Health
78
Technical
72
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
99%
Other

NocoBase

No Code Platforms · Low Code Platforms

23,696

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
65
Dependency
Built with
TypeScript99%
Updated today

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

Search