You are currently offline, serving cached version

Asynchronous Data Resolving

You can have promises in your data. Note that the only step running asynchronously is the resolving of your data. The compilation (parsing of your template to parse position of each tags), and the rendering (using the compiled version + the resolved data) will still be fully synchronous

// Compile your document
var doc = new Docxtemplater(zip, options);

doc.renderAsync({user: new Promise(resolve) { setTimeout(()=> resolve('John'), 1000)}})
   .then(function() {
       var buf = doc.getZip()
           .generate({type: 'nodebuffer'});
       fs.writeFileSync(path.resolve(__dirname, 'output.docx'), buf);