Releases RSS Feed
Compatibility : nodejs and browser

Summary (version 3.0.5) Buy word-run module

This module exposes a tag to insert raw runs (<w:r>) inside the document. This makes it possible to include styled text without having to remove the enclosing paragraph like in the {@rawXml} tag.

This module is available as part of the docxtemplater PRO plan.


WRun module for docxtemplater.


You will need docxtemplater v3: npm install docxtemplater

Install this module with npm install --save "$url"


Your docx should contain the text: {r@wrun} The following example will render some bold text

const fs = require('fs');
const WRunModule = require('docxtemplater-wrun-module');
const wrunModule = new WRunModule();

const wrun = "<w:r>" +
        "<w:rPr>" +
        "<w:b/>" +
        "<w:lang w:val="en-GB"/>" +
        "</w:rPr>" +
        "<w:t>bold</w:t>" +

const docx = new DocxGen()

const buffer = docx
  .generate({type:"nodebuffer", compression: "DEFLATE"});

fs.writeFile("test.docx", buffer);

After installing the module, you can use a working demo by running node sample.js.



  • Update browser build to use XMLSerializer instead of xmldom

  • Use requiredAPIVersion


  • Move docxtemplater from devDependencies to dependencies

Explanation : On some versions of npm (notably 5.8.0), when having a package containing docxtemplater-word-run-module, the installation will generate a tree of node_modules that puts the module on a level where it has no access to docxtemplater. By explicitly asking it as a dependency, this issue is avoided.


  • Make module compatible with docxtemplater version 3.5 and below.

Explanation : Recently, the scopemananger API (internal API) has changed, this new version of the footnotes module makes the module work with both versions newer than 3.6 and older than 3.6 of docxtemplater.


Add meta context argument to custom parser with information about the tag for each types of tags


Make it possible to use different prefix than "r@"


Initial release

Edgar Hipp

I'm the creator of docxtemplater. I work on making docxtemplater great since 2013.