Article URL: https://github.com/floodtide/dom-docx Comments URL: https://news.ycombinator.com/item?id=48891267 Points: 40 # Comments: 14

Convert semantic HTML fragments to native, editable Word documents (OOXML): paragraphs, runs, lists, tables, images. Not screenshots or layout hacks. Live demo: dom-docx.com. Try the converter, browse showcases, read the learn guide. Built with a visual regression loop: render HTML in Chromium, convert to docx, rasterize via LibreOffice, score layout + structural fidelity against a human-validated metric, iterate. Latest scores: TEST-SCORES.md · methodology: SCORING.md. Requires Node.js ≥ 20. No browser or Playwright is needed for the default inline path. On Node, playwright is an optional peer dependency. npm install dom-docx pulls only docx, cheerio and fflate, nothing heavy. It is loaded lazily when you pass styleSource: "computed" or rasterizeInPlace. To use those paths, install Playwright and Chromium yourself, once: Playwright is also used by the dev test harness (not required to use the library). Contributors: npm run setup after clone. LibreOffice is not needed to convert. It is only used for the visual test harness. No Playwright, no Node. This runs entirely in the user's tab. See Browser bundle below.