npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docx-fast-node

v0.1.0

Published

High-performance Word (.docx) parser with native Rust core

Readme

docx-fast-node

High-performance Word (.docx) parser with a native Rust core.

Features

  • Complete: Extracts paragraphs, tables, headers, footers, footnotes, endnotes, comments
  • Styled: Paragraph and character styles with inheritance
  • Lists: Numbering support (bullets and numbered lists)
  • Track Changes: Revision tracking support
  • Comments: Threaded comments with author information
  • TOC: Automatic table of contents generation from headings
  • Images: Extract embedded images
  • Arrow IPC: Export to Apache Arrow format for data processing
  • Fast: Memory-mapped files and streaming decompression
  • Safe: Rust's memory safety guarantees

Installation

npm install docx-fast-node

Quick Start

const { parseDocx } = require('docx-fast-node');

const doc = parseDocx('/path/to/document.docx');

// Metadata
console.log('Title:', doc.metadata.core.title);
console.log('Author:', doc.metadata.core.creator);
console.log('Pages:', doc.page_count);

// Table of contents
for (const entry of doc.toc) {
  console.log('  '.repeat(entry.level) + entry.text);
}

// Document content
for (const block of doc.blocks) {
  if (block.type === 'paragraph') {
    console.log(`[${block.style_name || 'Normal'}] ${block.text}`);
  } else if (block.type === 'table') {
    for (const row of block.rows) {
      const cells = row.cells.map(cell => {
        // Extract text from cell blocks
        return cell.blocks
          .filter(b => b.type === 'paragraph')
          .map(p => p.text)
          .join(' ');
      });
      console.log(cells.join(' | '));
    }
  }
}

Options

const doc = parseDocx('/path/to/document.docx', {
  maxInflate: 128 * 1024 * 1024,  // Max decompressed size in bytes (default: 128 MiB)
});

NDJSON Streaming

const { parseDocxNdjson } = require('docx-fast-node');

parseDocxNdjson('/path/to/document.docx', '/tmp/out.ndjson');

Output format (one JSON object per line):

{"kind":"metadata","metadata":{"core":{"title":"My Doc"}},"settings":{},"toc":[]}
{"kind":"style","style":{"id":"Heading1","name":"Heading 1","is_default":false}}
{"kind":"block","block":{"type":"paragraph","text":"Hello World"}}

Arrow IPC Export

Export document tables to Apache Arrow format:

const { parseDocxArrowDataset } = require('docx-fast-node');

// Export all tables to Arrow IPC files
const files = parseDocxArrowDataset('/path/to/doc.docx', '/tmp/arrow-output');
console.log('Created:', files);

Image Extraction

const { extractDocxImages } = require('docx-fast-node');

const imagePaths = extractDocxImages('/path/to/document.docx', './extracted-images');
console.log('Extracted images:', imagePaths);

TypeScript Support

TypeScript definitions are included:

import { parseDocx, DocxDocument, Paragraph, Table } from 'docx-fast-node';

const doc: DocxDocument = parseDocx('document.docx');

Document Structure

DocxDocument
├── metadata (core, app, custom properties)
├── settings (document settings)
├── page_count
├── toc (auto-generated table of contents)
├── styles (paragraph, character, table styles)
├── numbering (list definitions)
├── blocks (paragraphs and tables)
│   ├── Paragraph { runs: [Run { text, bold, italic, ... }] }
│   └── Table { rows: [Row { cells: [Cell { blocks }] }] }
├── headers / footers
├── footnotes / endnotes
├── comments (with thread support)
├── revisions (track changes)
├── fields (TOC, page numbers, etc.)
└── images (embedded references)

Performance

  • 10x faster than python-docx
  • Low memory footprint: Streaming decompression for large files
  • Parallel-ready: Stateless parsing allows concurrent processing

Platform Support

Prebuilt binaries available for:

  • macOS (Intel & Apple Silicon)
  • Linux (x64, ARM64)
  • Windows (x64)

License

MIT

Related Packages

  • xlsx-fast-node - Excel (.xlsx) parser
  • pptx-fast-node - PowerPoint (.pptx) parser