harshankur/officeParser

A robust, strictly-typed Node.js and Browser library for parsing office files into a rich Abstract Syntax Tree (AST) and generating high-fidelity output in multiple formats. Parses: docx · pptx · xlsx · odt · odp · ods · pdf · rtf · csv · md · html. Generates: Markdown · HTML · CSV · RTF · PDF · Plain Text · RAG Chunks

What it solves

officeParser solves the challenge of working with diverse office document formats by providing a unified, strictly-typed way to read, convert, and generate files. It eliminates the need for multiple specialized tools by parsing complex documents—including PDFs, Word files, spreadsheets, and LaTeX—into a consistent, hierarchical structure called an Abstract Syntax Tree (AST).

How it works

The library parses input files into an AST that represents the document's content, structure, and metadata. Once in this format, you can programmatically inspect the document, apply configurations (like OCR or content filtering), and generate high-fidelity output in a wide variety of formats. It supports advanced features like mail-merge templating, native PDF generation without a headless browser, and layout-faithful text extraction.

Who it’s for

It is designed for developers working in Node.js or browser environments who need to build document-processing pipelines, RAG (Retrieval-Augmented Generation) applications, or conversion tools that require high accuracy and structural integrity across different file types.

Highlights

  • Broad Format Support: Parses and generates DOCX, PPTX, XLSX, ODT, ODP, ODS, PDF, RTF, CSV, Markdown, HTML, EPUB, and LaTeX.
  • Advanced PDF Engine: Rebuilt in v8 to handle multi-column layouts, merged cells, and complex geometry, with native PDF generation that avoids headless browser dependencies.
  • Template Engine: Supports mail-merge functionality (OfficeTemplate) to fill placeholders, loops, and conditional logic in Word and OpenDocument templates.
  • Interactive Debugging: Includes a live browser-based AST visualizer to inspect nodes, test configurations, and preview output in real-time.
  • RAG-Ready: Provides native chunking capabilities for document indexing and retrieval tasks.

Related

  • Project
  • Project
  • Project
  • Project
  • Project