# transform-doc-to-html

> transform docx file content to html or text

Latest version **1.1.4** (published 2022-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install transform-doc-to-html
pnpm add transform-doc-to-html
yarn add transform-doc-to-html
bun add transform-doc-to-html
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-08-23 |
| First published | 2022-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 535.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | junda.mao |
| Maintainers | junda.mao |
| Keywords | javascript, transform, docx, file, html, read file |

## Links

- npm: https://www.npmjs.com/package/transform-doc-to-html
- npm.io page: https://npm.io/package/transform-doc-to-html

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2022-08-23
- 1.1.3 — 2022-08-18
- 1.1.2 — 2022-08-18
- 1.1.1 — 2022-08-17
- 1.1.0 — 2022-08-16
- 1.0.3 — 2022-08-16
- 1.0.2 — 2022-08-16
- 1.0.1 — 2022-08-16
- 1.0.0 — 2022-08-16

## README

## transform .docx file to html

### Installation
```js
npm install transform-doc-to-html
```
### Usage
as react lib

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

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

as function

```js
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

---
_Source: https://npm.io/package/transform-doc-to-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
