Demo
Readme
Changelog
Releases RSS Feed
Compatibility : nodejs and browser

Summary (version 3.1.1) Buy error-location module

This module makes it possible to locate errors

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

README

Error location Module

This module makes it possible to locate errors in a word/document.

Installation:

You will need docxtemplater v3: npm install docxtemplater

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

Usage

const ErrorLocationModule = require("docxtemplater-error-location-module");
const errorModule = new ErrorLocationModule();
doc.attachModule(errorModule);
// Now all your errors will be enhanced with locationWord

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

Options

If you would like to change the author name and date of the comments, you can by using following code :

const errorModule = new ErrorLocationModule({
    author: "My author name",
    date: new Date(),
});

date takes a Date parameter as an input, and author a string

try {
    doc.compile();
}
catch (e) {
    errorModule.addComments();
    throw e;
}

Translation of messages

It is possible to translate the messages shown as comments in the document (if your end-users do not speak english), by providing a translation file.

An example with Dutch can be used with following code :

const errorModule = new ErrorLocationModule({
    translations: require("docxtemplater-error-location-module/translations/dutch.js"),
});

Please contact me if you would like to have a translation for another language

CHANGELOG

3.1.1

  • Move docxtemplater from devDependencies to dependencies

Explanation : On some versions of npm (notably 5.8.0), when having a package containing docxtemplater-error-location-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.

3.1.0

Add support for language translation (with Dutch for now)

3.0.3

Make error-location module work with comments even when the HTML module is attached

3.0.2

Commenter does not change file if there are no errors

3.0.1

Make it possible to overwrite author + date of the comments

3.0.0

Initial release

Edgar Hipp

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