HTML to Docxjs XmlComponent Compiler

(npmjs.com)

2 points | by janishars 1 day ago

1 comments

  • janishars 1 day ago
    Hi everyone.

    Some time ago I was struggling with generating Word documents dynamically. I was using the node docxjs library, which is great, but it was missing one feature I really needed: the ability to parse HTML text from a WYSIWYG editor and insert it into a Word document while still using the docx API.

    From that need, I built an HTML → docx XmlComponent compiler. It parses the provided HTML and converts it into a list of XmlComponent elements that can be embedded directly into the docx API. And its not limited to one insert, you can create whole document from multiple parsed html.

    I’d love to hear your thoughts and feedback on it.