Skip to content

v6.1.0

Choose a tag to compare

@github-actions github-actions released this 14 Apr 14:04

v6.1.0: Infrastructure Stability & Smart OCR Scheduling

Changes: v6.0.7..v6.1.0

This release marks a major milestone in the technical maturity of officeParser, moving from a monolithic parser to a robust, resource-aware infrastructure. v6.1.0 focuses on stability, performance, and developer experience without breaking core backward compatibility.


🔥 Major Highlights

📦 Modern Module System & Nomenclature Change

Since v6.0.7, we have standardized our browser distribution to support modern development workflows. This includes a major change in bundle naming:

  • Nomenclature Change: officeparser.browser.js or officeParserBundle@${VERSION}.js has been renamed to officeparser.browser.iife.js to explicitly indicate its format.
  • Dual-Bundle System: We now ship two distinct browser packages (add @${VERSION} after officeparser if using release asset):
    1. officeparser.browser.iife.js: Standard IIFE bundle for direct <script> tag usage (Global officeParser namespace).
    2. officeparser.browser.mjs: A native ESM bundle for modern browsers, Vite, and Webpack 5.
  • Node.js: Full native ESM support with Node16 resolution.

🧠 Smart OCR Worker Pool

We’ve completely rewritten the OCR engine to handle internal resource management intelligently.

  • Lazy Initialization: OCR workers and tesseract.js are now lazy-loaded. Simply require or import the library at the top-level no longer spawns any background processes, resolving the long-standing "process leak" issue.
  • Worker Pooling: Workers are now pooled and reused across parallel parsing requests, providing up to 3x faster processing for documents with multiple images.
  • Auto-Termination: A new idle-timer automatically cleans up worker processes after 10 seconds of inactivity (configurable via ocrConfig.autoTerminateTimeout).
  • Manual Control: Exported a new terminateOcr() function for snappy CLI script exits.

📦 Infrastructure Migration

  • Fflate Integration: Replaced legacy yauzl with fflate for zero-memory-buffer zip extraction, significantly improving performance on massive spreadsheets and low-memory environments like Edge Functions.
  • PDF.js v5: Upgraded the internal PDF engine to the latest stable release (v5.6.205) with improved text-layer coordinate alignment.

🏷️ Custom Property Extraction

You can now extract user-defined custom metadata (e.g., custom tags, proprietary fields) across almost all formats:

  • OOXML: Standard custom document properties (docProps/custom.xml).
  • ODF: User-defined fields in OpenOffice/LibreOffice metadata.
  • PDF: Custom key-value pairs from the PDF Info dictionary.

📄 Documentation & Branding Overhaul

  • Premium SPA Docs: A completely redesigned live documentation site with persistent fragments.
  • Interactive Visualizer: Test any file in-browser to see the hierarchical AST and real-time preview.
  • Troubleshooting Guide: A new, comprehensive debugging guide covering everything from process hangs to PDF worker resolution.
  • Metric Verification: Standardized all download metrics to 260k+ weekly installs with dynamic Shields.io badges and live verification links via npm-stat.com.

🛠️ API & Configuration Changes

New Configuration Options (OfficeParserConfig)

  • ocrConfig: New object for fine-grained OCR control.
  • ocrConfig.autoTerminateTimeout: Duration (ms) to keep workers alive before cleanup.
  • ocrConfig.workerPath, ocrConfig.corePath, ocrConfig.langPath: Full support for air-gapped/offline local Tesseract hosting.

Deprecations

  • ocrLanguage: This string property is now deprecated. Use ocrConfig.language instead. (Note: Existing code using ocrLanguage will continue to work perfectly in v6.1.0).

🐛 Bug Fixes & Refinements

  • PDF: Fixed hierarchical alignment where links sometimes drifted from their corresponding text nodes.
  • ODT/RTF: Improved list parsing to accurately reflect nested indentation levels in the AST.
  • CLI: The command-line interface now automatically calls terminateOcr() for a faster return to the prompt.
  • Sponsorship: Integrated funding.json and .well-known manifest support for community sustainability.

⚠️ Migration Note for v6.0.7 Users

  1. Nomenclature: If you were using a script tag, update your source from officeparser.browser.js or officeParserBundle@${VERSION}.js to officeparser.browser.iife.js.
  2. Process Lifecycle: Node.js scripts using OCR may stay alive for 10s after finishing due to the worker pool. Call await terminateOcr() for an immediate exit.

❤️ Contributors

A huge shoutout to @carlosb1504 for their massive contributions, specifically replacing yauzl with fflate for improved performance and implementing the core custom property extraction logic.

Full Changelog: v6.0.7...v6.1.0