v6.1.0
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.jsorofficeParserBundle@${VERSION}.jshas been renamed toofficeparser.browser.iife.jsto explicitly indicate its format. - Dual-Bundle System: We now ship two distinct browser packages (add
@${VERSION}after officeparser if using release asset):officeparser.browser.iife.js: Standard IIFE bundle for direct<script>tag usage (GlobalofficeParsernamespace).officeparser.browser.mjs: A native ESM bundle for modern browsers, Vite, and Webpack 5.
- Node.js: Full native ESM support with
Node16resolution.
🧠 Smart OCR Worker Pool
We’ve completely rewritten the OCR engine to handle internal resource management intelligently.
- Lazy Initialization: OCR workers and
tesseract.jsare now lazy-loaded. Simplyrequireorimportthe 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
yauzlwithfflatefor 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. UseocrConfig.languageinstead. (Note: Existing code usingocrLanguagewill 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.jsonand.well-knownmanifest support for community sustainability.
⚠️ Migration Note for v6.0.7 Users
- Nomenclature: If you were using a script tag, update your source from
officeparser.browser.jsorofficeParserBundle@${VERSION}.jstoofficeparser.browser.iife.js. - 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