extract-from-docx

1.0.4 • Public • Published

extract-from-docx

Extracts text and table data from .docx files and returns a Promise in the form of an object.

Installation

You can install extract-from-docx via npm or yarn:

  • Node

    npm install extract-from-docx
    
  • Yarn

    yarn add extract-from-docx
    

Usage

  • Below is an example of usage of package.

    const { extractText, extractTables } = require('extract-from-docx');
    
    # Specify the path to the .docx file
    const docxFilePath = 'path/to/your/document.docx';
    
    # Extract text from the document
    extractText(docxFilePath)
    .then(text => {
        console.log('Extracted Text:', text);
    })
    .catch(error => {
        console.error('Error extracting text:', error);
    });
    
    # Extract tables from the document
    extractTables(docxFilePath)
    .then(tables => {
        console.log('Extracted Tables:', tables);
    })
    .catch(error => {
        console.error('Error extracting tables:', error);
    });

Readme

Keywords

Package Sidebar

Install

npm i extract-from-docx

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

4.18 kB

Total Files

3

Last publish

Collaborators

  • arnavgaur