You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@emilgroup/docxtemplater-util

Package Overview
Dependencies
Maintainers
20
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package was compromised as part of the ongoing "CanisterWorm" supply chain attack.

Affected versions:

1.1.21.1.31.1.4
View campaign page

@emilgroup/docxtemplater-util

Helper library to simplify interaction with docxtemplater

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
504
7100%
Maintainers
20
Weekly downloads
 
Created
Source

Emil docxtemplater-util

Helper library to simplify interaction with docxtemplater.

This package provides a list of filters you can apply to your parser using the builder, so you do not need to copy paste all the formatters between repositories.

How do I get set up?

Install the package:

npm install @emilgroup/docxtemplater-util --save

Setup configuration for dayjs:

import { setupDayjs } from '@emilgroup/docxtemplater-util';

setupDayjs();

This one applies default options for dayjs.

You can also change the options for dayjs with this function call, you can pass the defaultTimezone or locale to use. Take a look at the following example:

import { setupDayjs } from '@emilgroup/docxtemplater-util';

setupDayjs({
  defaultTimezone: 'Europe/Berlin',
  locales: ['de', 'fr', 'it'],
});

Then you can use the package in your project like so:

import angularParser from 'docxtemplater/expressions';
import { FiltersBuilder } from '@emilgroup/docxtemplater-util';

FiltersBuilder.default(angularParser).applyFilters();

This code snippet applies all the pre-defined filters to your angularParser.

You also have ability to add new filters using the builder.

import angularParser from 'docxtemplater/expressions';
import { FiltersBuilder } from '@emilgroup/docxtemplater-util';

const builder = new FiltersBuilder(angularParser);

builder.addFilter('foo', (str: string): string => {
  return str.concat('[foo]');
});
builder.addFilter('reverse', (str: string): string => {
  return str.split('').reduce((acc, char) => char + acc, '');
});

builder.applyFilters();

This one creates a new builder instance add adds custom filters to it

How to maintain?

In case if you want to add a new filter just create new file with the following naming [filter-name]-filters.ts in the filters folder. If you update the exiting one, you will not need to do anything else, otherwise you will be need to update index.ts and filters-builder.ts to apply new filters.

License

MIT

Keywords

docxtemplater

FAQs

Package last updated on 25 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts