@gzzhanghao/docx2quill

0.3.1 • Public • Published

docx2quill

Convert DocX to Quill Delta.

This package is under heavy development, use it at your own risk

Usage

import docx2Quill from '@gzzhanghao/docx2quill'

docx2Quill(docxBuffer, {

  /**
   * Custom image processor
   */
  async processImage(parser, filePath, size) {
    parser.delta = parser.delta.insert({
      image: await uploadImage(await parser.zip.file(filePath).async('nodebuffer'))
    }, {
      width: size.width,
      height: size.height,
    })
  },

  /**
   * Report for item not found error
   */
  notfoundError(type, id) {
    // type: number | abstract number | level | relationship | style
  },

}).then(delta => {

  // delta: Quill Delta
})

Readme

Keywords

none

Package Sidebar

Install

npm i @gzzhanghao/docx2quill

Weekly Downloads

3

Version

0.3.1

License

MIT

Last publish

Collaborators

  • gzzhanghao