New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

docxtemplater-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docxtemplater-cli

This repository contains code for the docxtemplater-cli

  • 3.7.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

docxtemplater-cli

This repository contains code for the docxtemplater-cli

Installation

To install the cli, run :

npm install -g docxtemplater-cli

Run

To run docxtemplater, run :

docxtemplater input.docx data.json output.docx

It is possible to set the delimiters, or some other option by using some json in the options argument like this :

docxtemplater --options '{"delimiters": {"start": "[[", "end": "]]"}}' input.docx data.json output.docx

Attaching modules

Since version 3.7.0, released in February 2023, you can include modules using the --modules flag

To use this flag, you first need to create a file on your file system like this :

In this file you need to export an Array of all modules that you want to include

my-modules.js

const ImageModule = require("docxtemplater-image-module");
const imageOpts = {
  centered: false,
  getImage: function (tagValue, tagName) {
    return fs.readFileSync(tagValue);
  },
  getSize: function (img, tagValue, tagName) {
    // it also is possible to return a size in centimeters, like this : return [ "2cm", "3cm" ];
    return [150, 150];
  },
};
module.exports = [new ImageModule(imageOpts)];

Then, in your calling code, use it like this :

docxtemplater --modules my-modules.js input.docx data.json output.docx

FAQs

Package last updated on 09 Feb 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc