Gathering detailed insights and metrics for html-docx-js-typescript
Gathering detailed insights and metrics for html-docx-js-typescript
Gathering detailed insights and metrics for html-docx-js-typescript
Gathering detailed insights and metrics for html-docx-js-typescript
@types/html-docx-js
TypeScript definitions for html-docx-js
html-docx-js-typescript-papersize-thenn
Convert HTML documents to docx format.
html-docx-js-extends
基于html-docx-js-typescript的扩展,支持将多段html转换为docx文档,并分段设置纵横方向,以及简单页眉和页码的设置.
html-docx-ts
Convert HTML documents to docx format with header and footer.
Convert HTML documents to docx format.
npm install html-docx-js-typescript
Typescript
Module System
Node Version
NPM Version
85.1
Supply Chain
91
Quality
74
Maintenance
100
Vulnerability
98.6
License
TypeScript (99.29%)
JavaScript (0.71%)
Total Downloads
1,106,102
Last Day
325
Last Week
8,785
Last Month
37,806
Last Year
460,273
MIT License
94 Stars
16 Commits
18 Forks
4 Watchers
14 Branches
1 Contributors
Updated on Jun 11, 2025
Minified
Minified + Gzipped
Latest Version
0.1.5
Package Id
html-docx-js-typescript@0.1.5
Unpacked Size
43.69 kB
Size
11.29 kB
File Count
57
NPM Version
6.13.4
Node Version
10.18.0
Cumulative downloads
Total Downloads
Last Day
14.8%
325
Compared to previous day
Last Week
-2.4%
8,785
Compared to previous week
Last Month
-3.1%
37,806
Compared to previous month
Last Year
54.5%
460,273
Compared to previous year
Rewrite html-docx-js with Typescript.
Convert HTML documents to docx format.
npm install html-docx-js-typescript --save-dev
Support node.js and browser enviroment, including vue/react/angular.
1import { asBlob } from 'html-docx-js-typescript' 2// if you want to save the docx file, you need import 'file-saver' 3import { saveAs } from 'file-saver' 4 5const htmlString = `<!DOCTYPE html> 6<html lang="en"> 7<head> 8 <meta charset="UTF-8"> 9 <title>Document</title> 10</head> 11<body> 12 <h1>Welcome</h1> 13</body> 14</html>` 15 16export default { 17 methods: { 18 saveDocx() { 19 asBlob(htmlString).then(data => { 20 saveAs(data, 'file.docx') // save as docx file 21 }) // asBlob() return Promise<Blob|Buffer> 22 }, 23 }, 24}
And you can set options including margins and orientation.
1const data = await asBlob(htmlString, { orientation: 'landscape', margins: { top: 100 } })
If you use this package in a Typescript file and declare the options to an independent Object
like:
1import { asBlob } from 'html-docx-js-typescript' 2const opt = { 3 margin: { 4 top: 100 5 }, 6 orientation: 'landscape' // type error: because typescript automatically widen this type to 'string' but not 'Orient' - 'string literal type' 7} 8await asBlob(html, opt)
You can use as const
to avoid type widening.
1const opt = { 2 margin: { 3 top: 100 4 }, 5 orientation: 'landscape' as const 6}
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
42 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More