The `docx-parser` package, at version 0.2.1, is an abandoned JavaScript library last published in October 2016. Its primary function is to extract plain text content from Microsoft Word `.docx` files using a simple, callback-based CommonJS API. It focuses solely on basic text extraction without support for rich text formatting, images, tables, or intricate document structures. Due to its age, it lacks modern features like Promise-based APIs, ESM support, or TypeScript typings, and is not actively maintained. Developers seeking robust DOCX parsing with comprehensive features, active development, and modern JavaScript/TypeScript compatibility should consider contemporary alternatives such as `@thasmorato/docx-parser` or `officeparser`, which offer streaming capabilities, memory efficiency, detailed Abstract Syntax Tree (AST) output, and broader support for office file formats.
npm install docx-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the `docx-parser` module and use its `parseDocx` function to extract plain text from a DOCX file using a callback. Users must provide a valid DOCX file.
Ensure your project uses CommonJS (`require()`) for this package, or use a tool like Webpack/Rollup with CJS compatibility configured. Consider migrating to a modern parser for ESM support.
Wrap the callback function in a Promise manually if you need `async/await` compatibility, or use an actively maintained package that supports modern asynchronous patterns.
For new projects or production environments, it is highly recommended to use a currently maintained and more robust DOCX parsing library. Examples include `@thasmorato/docx-parser` or `officeparser`.
If your application requires extraction of formatting, images, or a structured representation of the DOCX content (e.g., as an AST), this package is unsuitable. Look for libraries that explicitly advertise 'rich text parsing', 'AST output', or 'HTML conversion'.
Use `const docxParser = require('docx-parser');` instead of `import` statements. Also ensure the package is installed via `npm install docx-parser`.Verify that `const docxParser = require('docx-parser');` is at the top of your file and that `npm install docx-parser` completed successfully. Ensure the variable name matches `docxParser`.Ensure the input file is a genuine and uncorrupted `.docx` document. Open it in a program like 7-Zip or WinRAR to verify its internal structure (it should contain XML files like `word/document.xml`).
No dependency data recorded yet.