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 is a universal document parser and generator designed to handle a wide variety of office file formats. It solves the problem of extracting structured data from fragmented formats like DOCX, PDF, and XLSX, and converting them into a unified Abstract Syntax Tree (AST) that can be easily transformed into other formats or used in AI pipelines.

How it works

The library parses input files into a rich, hierarchical AST. This AST acts as an intermediate representation, allowing the library to support a vast array of input and output formats. Users can then use the OfficeGenerator to transform this AST into specific outputs, such as Markdown, HTML, or plain text. It also includes an OCR engine (via Tesseract) for extracting text from images within documents.

Who it’s for

  • Developers building document processing pipelines.
  • AI/LLM Engineers needing to prepare high-fidelity data for RAG (Retrieval-Augmented Generation) pipelines.
  • Web Developers creating tools that convert office documents to web-ready formats.

Highlights

  • Broad Format Support: Parses 12 formats including DOCX, PPTX, XLSX, PDF, ODT, and EPUB.
  • RAG-Ready Chunking: Native support for document-structure, fixed-size, and semantic chunking strategies.
  • AST-Based Architecture: Provides a strictly-typed AST for deep inspection and manipulation of document content.
  • Flexible Output: Generates Markdown, HTML, CSV, RTF, PDF, EPUB, and plain text.
  • OCR Integration: Built-in OCR for scanned documents and images.
  • Cross-Platform: Works in both Node.js and the browser.

Related

  • Project
  • Project
  • Project
  • Project
  • Project