Read docx file using javascript

Hi,
I have 3 docx files.
1. First Docx with Header and footer images.
2. Docx with content with formatting
3. Docx containing tables with formatting.

Now i want to read 3 docx and place in separate 4th docx file without loosing the formatting.
In 2nd 3rd docx s I need to break the content and pick some text based on condition.

I tried using docxtemplater but I am unable to get the text with formatting when breaking the 3rd 4th docx files.

Please let me know if any other way we can do using javascript or jquery with example.