explaingit

anulman/docx-sax

Analysis updated 2026-05-18

0C#Audience · developerComplexity · 4/5Setup · moderate

TLDR

A .NET library and CLI/Node/browser tool that streams low level parsing events from inside .docx files instead of returning a finished document object.

Mindmap

mindmap
  root((docx-sax))
    Core Library
      OpenXML SDK
      Typed Events
      .NET 8
    Interfaces
      CLI JSONL
      Node Wrapper
      Browser WASM
    Event Types
      Package
      Part
      Relationship
      Element
      Text
    Non Goals
      No Paragraph Model
      No Editing
      No JSON First Core

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a custom document processing pipeline that needs raw, low level access to a docx file's internal XML structure.

USE CASE 2

Parse uploaded Word documents directly in a browser using the WebAssembly build, without sending files to a server.

USE CASE 3

Stream large docx files as JSONL events from the command line for logging or downstream processing.

USE CASE 4

Use the Node.js wrapper to inspect docx file internals as part of a document conversion or validation tool.

What is it built with?

.NET 8C#Open XML SDKNode.jsWebAssemblyNext.js

How does it compare?

anulman/docx-saxatrblizzard/vtmb-sbox-mounterjason-snell/npm-age-checker-proxy
Stars000
LanguageC#C#C#
Setup difficultymoderatemoderate
Complexity4/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires the .NET 8 SDK and, for the browser build, Node.js and Playwright/Vite tooling for the WASM demo.

In plain English

docx-sax is a developer tool for reading the internal structure of Word docx files. Instead of giving you a finished document object with paragraphs and headings, it streams out low level events as it walks through the file's OpenXML package: when a part starts and ends, what relationships exist between files inside the package, when an XML element opens or closes, and when text is found. It keeps details like namespaces, attribute values, file paths, and event order intact, which makes it useful for people who need precise control over how a docx file is parsed rather than a simplified summary. The core is a .NET 8 library built on Microsoft's Open XML SDK. Around that core, the project offers several ways to use the parser depending on your platform. There is a command line tool that outputs one JSON event per line, a Node.js wrapper that reads docx files from disk, and a browser wrapper built on WebAssembly that reads file bytes directly, useful for parsing uploaded documents in a web page without a server round trip. All three interfaces share the same event structure, so code written against one behaves consistently across the others. The project is explicit about what it will not do. It has no interest in offering paragraph or heading level concepts, no document editing or authoring features, and no JSON first design in its core library. It is meant purely as a low level walker over the file format, leaving any higher level interpretation to whoever uses it. The repository includes a Next.js demo app that shows the browser version parsing an uploaded docx file live. Development uses standard dotnet and npm tooling, with a continuous integration setup that builds and tests across Linux, Windows, and macOS. The project is still early stage, versioned in the 0.x range while its event format continues to change, and it recommends prerelease version numbers until the API is considered stable.

Copy-paste prompts

Prompt 1
I want to parse a .docx file's internal OpenXML structure as a stream of events instead of loading the whole document into memory. Show me how a SAX style parser for XML works and how it would apply to docx files.
Prompt 2
Explain the relationship between a docx package, its parts, and its relationships in the OpenXML format.
Prompt 3
Write a Node.js script that consumes an async iterable of typed events from a document parser and counts how many text nodes appear at each depth.
Prompt 4
How would I parse a docx file entirely in the browser using WebAssembly instead of uploading it to a server first?
Prompt 5
I need to build a JSONL output format from a stream of typed parser events. Show me a pattern for serializing each event as one line of JSON reliably.

Frequently asked questions

What is docx-sax?

A .NET library and CLI/Node/browser tool that streams low level parsing events from inside .docx files instead of returning a finished document object.

What language is docx-sax written in?

Mainly C#. The stack also includes .NET 8, C#, Open XML SDK.

How hard is docx-sax to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is docx-sax for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.