Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
MIT License
Bot releases are visible (Hide)
Published by dolanmiu over 4 years ago
Multiple paragraphs in footnotes - https://github.com/dolanmiu/docx/pull/484
Vertical text support for tables - https://github.com/dolanmiu/docx/pull/540
Published by dolanmiu almost 5 years ago
Fix exports again
Published by dolanmiu almost 5 years ago
Fix exports - https://github.com/dolanmiu/docx/pull/490
Published by dolanmiu almost 5 years ago
https://github.com/dolanmiu/docx/pull/428 - Putting docx in a proper namespace rather than the global one
https://github.com/dolanmiu/docx/pull/447 - Declarative numbering
https://github.com/dolanmiu/docx/pull/448 - Fix hyperlink id
https://github.com/dolanmiu/docx/pull/454 - Table borders
https://github.com/dolanmiu/docx/pull/458 - Declarative tabs and page numbers
https://github.com/dolanmiu/docx/pull/459 - Alignment of tables
https://github.com/dolanmiu/docx/pull/460 - Overlap option for tables
https://github.com/dolanmiu/docx/pull/465 - "Right" alias to end
https://github.com/dolanmiu/docx/pull/466 - Declarative foot notes
https://github.com/dolanmiu/docx/pull/474 - Contextual spacing in paragraph styles
https://github.com/dolanmiu/docx/pull/476 - Fixes issue where there is an empty paragraph at start
https://github.com/dolanmiu/docx/pull/478 - Declarative Bookmarks
Published by dolanmiu about 5 years ago
https://github.com/dolanmiu/docx/pull/416 - Table of contents fix
https://github.com/dolanmiu/docx/pull/415 - Export RunFonts
https://github.com/dolanmiu/docx/pull/413 - Add SymbolRun
https://github.com/dolanmiu/docx/pull/419 - Revert "fix: try to remove unnecessary paragraph", which caused #418
https://github.com/dolanmiu/docx/pull/421 - Declarative styles
Published by dolanmiu about 5 years ago
Published by dolanmiu about 5 years ago
https://github.com/dolanmiu/docx/pull/373
https://github.com/dolanmiu/docx/pull/371
https://github.com/dolanmiu/docx/pull/336
https://github.com/dolanmiu/docx/pull/337
https://github.com/dolanmiu/docx/pull/340
https://github.com/dolanmiu/docx/pull/341
It was a tough decision, but a lot of thought was put into it. Now the Paragraph API is more declaritive. Method chaining is now slowly being deprecated.
You can read more of why method chaining is bad here:
https://stackoverflow.com/questions/1103985/method-chaining-why-is-it-a-good-practice-or-not
https://softwareengineering.stackexchange.com/a/266585/249600
From this:
To this:
The reason for this is that, the code will not give a compile error if you do:
new Paragraph(text).heading1().heading2()
...but instead, it will break the Word document itself. This is clearly a design flaw and allows for potential bugs and issues.
Now at least one section is required per document. Check the demo folder for examples, and here for the documentation: https://docx.js.org/#/usage/sections
Packer is now static: https://github.com/dolanmiu/docx/pull/373
Published by dolanmiu over 5 years ago
Published by dolanmiu over 5 years ago
Published by dolanmiu over 5 years ago
Published by dolanmiu over 5 years ago
Tables are more intuative to use and well documented:
https://github.com/dolanmiu/docx/pull/228
Rename some methods:
https://github.com/dolanmiu/docx/pull/207
Swap arguments around:
https://github.com/dolanmiu/docx/pull/206
Add .dotx
support:
https://github.com/dolanmiu/docx/pull/179
Floating tables + margains:
https://github.com/dolanmiu/docx/pull/288
https://github.com/dolanmiu/docx/pull/217
https://github.com/dolanmiu/docx/pull/205
https://github.com/dolanmiu/docx/pull/201
https://github.com/dolanmiu/docx/pull/197
https://github.com/dolanmiu/docx/pull/195
https://github.com/dolanmiu/docx/pull/220
https://github.com/dolanmiu/docx/pull/229
https://github.com/dolanmiu/docx/pull/202
Outline level: https://github.com/dolanmiu/docx/pull/248
e2e Testing! https://github.com/dolanmiu/docx/pull/246
Google docs left right margain support https://github.com/dolanmiu/docx/pull/276
Add cantSplit and tableHeaderRow properties into tables https://github.com/dolanmiu/docx/pull/275
https://github.com/dolanmiu/docx/pull/279
Add bold and italics to character style + customize hyperlink https://github.com/dolanmiu/docx/pull/278
Column merging https://github.com/dolanmiu/docx/pull/274
% missing from pct https://github.com/dolanmiu/docx/pull/282
Shading for table cell https://github.com/dolanmiu/docx/pull/292
Thanks you all for the contributions! Keep 'em coming!
Published by dolanmiu over 5 years ago
Published by dolanmiu almost 6 years ago
Published by dolanmiu almost 6 years ago
Adding image wrapping and margin support
Add createFirstPageFooter and createEvenPageFooter
Published by dolanmiu almost 6 years ago
Published by dolanmiu almost 6 years ago
https://github.com/dolanmiu/docx/pull/201 Add correct docx mime type
Published by dolanmiu almost 6 years ago
Published by dolanmiu about 6 years ago
Published by dolanmiu about 6 years ago
Published by dolanmiu about 6 years ago
https://github.com/dolanmiu/docx/pull/161
https://github.com/dolanmiu/docx/pull/160
https://github.com/dolanmiu/docx/pull/159
https://github.com/dolanmiu/docx/pull/156
https://github.com/dolanmiu/docx/pull/153
https://github.com/dolanmiu/docx/pull/152
https://github.com/dolanmiu/docx/pull/147
https://github.com/dolanmiu/docx/pull/141