0.2.0 • Published 7 years ago

@gzzhanghao/docx v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

docx

A dead simple docx parser.

Usage

import parseDocx from '@gzzhanghao/docx'

parseDocx(buffer).then(async docx => {

  // access jszip object
  docx.zip

  // read file in docx
  // type: string | text | binarystring | base64 | array | uint8array | arraybuffer | nodebuffer
  await docx.readFile(path, type)

  // parse xml file in docx
  await docx.parseFile(path)

  // access to files in docx
  docx.relations // word/_rels/document.xml.rels
  docx.document  // word/document.xml
  docx.numbering // word/numbering.xml
  docx.comments  // word/comments.xml
  docx.styles    // word/styles.xml
})