docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.

MIT License

Downloads
690.7K
Stars
4K
Committers
104

Bot releases are visible (Hide)

docx - 5.1.0

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

docx - 5.0.2

Published by dolanmiu almost 5 years ago

Fix exports again

docx - 5.0.1

Published by dolanmiu almost 5 years ago

docx - 5.0.0

Published by dolanmiu almost 5 years ago

Happy new Year everyone!

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

docx - 5.0.0-rc7

Published by dolanmiu about 5 years ago

Declarative styles and allow multiple tab stops

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

docx - 5.0.0-rc5

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

Major breaking changes

Declaritive API

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:

image

To this:

image

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.

Sections

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

Static Packer

Packer is now static: https://github.com/dolanmiu/docx/pull/373

docx - 5.0.0-rc3

Published by dolanmiu over 5 years ago

docx - 5.0.0-rc2

Published by dolanmiu over 5 years ago

docx - 4.7.1

Published by dolanmiu over 5 years ago

docx - 4.6.0

Published by dolanmiu almost 6 years ago

Adding image wrapping and margin support

Add createFirstPageFooter and createEvenPageFooter

https://github.com/dolanmiu/docx/pull/237

docx - 4.5.0

Published by dolanmiu almost 6 years ago

Introduces floating images

and createEvenHeaderWrapper

https://github.com/dolanmiu/docx/pull/235

docx - 4.4.1

Published by dolanmiu almost 6 years ago

https://github.com/dolanmiu/docx/pull/201 Add correct docx mime type

docx - 4.4.0

Published by dolanmiu almost 6 years ago

docx - 4.3.0

Published by dolanmiu about 6 years ago