0.3.0 • Published 3 months ago

docx-tables v0.3.0

Weekly downloads
15
License
MIT
Repository
github
Last release
3 months ago

node-docx-tables

Node library to extract tables from docx (office open xml) documents

Install

npm i --save docx-tables

Usage

const docxTables = require('docx-tables')

docxTables({
  file: 'path/to/the/docx/file'
}).then((data) => {
  // .docx table data
  console.log(data)
}).catch((error) => {
  console.error(error)
})

Example

ab
cd

A .docx file containing above table will result following JSON output:

[
  {
    '0': [
      { position: { row: 0, col: 0 }, data: 'a\n' },
      { position: { row: 0, col: 1 }, data: 'b\n' }
    ],
    '1': [
      { position: { row: 1, col: 0 }, data: 'c\n' },
      { position: { row: 1, col: 1 }, data: 'd\n' }
    ]
  }
]

License

MIT

Author

saikksub

0.3.0

3 months ago

0.2.0

3 years ago

0.1.1

5 years ago

0.1.0

5 years ago