Skip to main content

CLI Tutorial

Merge Office documents with data from the command line with zero code.

Prerequisites

Download and install nodeJS v16+ from https://nodejs.org/.

Tip

run node --version from a terminal window to confirm installation.

Installation

Open a terminal window and run:

Terminal

npm i -g @yumdocs/yumdocs-cli

Getting started

  1. Create a Word document named input.docx, type {{field}} and save it in the project directory.
input.docx
{{field}}
  1. In the same project directory, create a file named data.json, and copy-paste:
{
"field": "Anything you see fit"
}
  1. Open a terminal window in the project directory and run:
Terminal

yumdocs input.docx data.json output.docx

  1. output.docx has been generated and the {{field}} placeholder has been replaced with Anything you see fit.
output.docx

Anything you see fit