1.1.4 • Published 4 years ago

transform-doc-to-html v1.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

transform .docx file to html

Installation

npm install transform-doc-to-html

Usage

as react lib

import Doc2Html from 'transform-doc-to-html'

function App(){
  return (
    <Doc2Html
      onResult={html => doSomething(html)}
      imageUploadOptions={{}}
    >
      <div>上传doc</div>
    </Doc2Html>
  )
}

or

as function

import { getHtmlFromDocFile, extractRawText } from 'transform-doc-to-html'

const html = await getHtmlFromDocFile(file, imageUploadOptions)
const text = await extractRawText(file)

options

  • onResult: return html,required
  • imageUploadOptions
    • api: upload interface
    • code: 'file' | 'image', interface param code
    • processResult: uploadResult => imageUrl
1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago