Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
docx2html is a javascript converter from docx to html on nodejs and browser.
npm install docx2html
const docx2html=require("docx2html")
docx2html(input.files[0])
/** you can do further with utilities in converted html
.then(html=>{
//html.toString()
//html.asZip/download/save
})
*/
docx2html(docx, options), return a promise object, options support
the promise object resolved with an object with following functions
It is based on docx4js 1.x to parse docx, and utilize docx4js api to traverse docx models and convert docx models to html elements.
Ideally, each docx model should have a specific converter to create accordingly html elements, so the design is simply to map from type of docx model to html element constructor.
While, the difficulty is that some docx models are difficult to be expressed in html. It's luckly that we have CSS3 that make some rich styles possible in html, such as numbering, all(12) kinds of table styles.
Word shape utilizes SVG to draw lines, rects, and etc, but so far it only supports limited shapes, while the left job is time.
P of html, according to HTML specification, is restricted not to include any block container, such as div, so there's no p tag, but all div with paragraph styles, and then do some arrangement when dom is ready with a small javascript code.
It keeps header and footer for every section, but there's no conditional consideration, such as odd and even header/footer.
Word Field is kept, while so far only link is supported.
environment
model
style
FAQs
a javascript docx converter to html based on docx4js
The npm package docx2html receives a total of 505 weekly downloads. As such, docx2html popularity was classified as not popular.
We found that docx2html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.