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
- Create a Word document named
input.docx, type{{field}}and save it in the project directory.
input.docx
{{field}}
- In the same project directory, create a file named
data.json, and copy-paste:
{
"field": "Anything you see fit"
}
- Open a terminal window in the project directory and run:
Terminal
yumdocs input.docx data.json output.docx
output.docxhas been generated and the{{field}}placeholder has been replaced withAnything you see fit.
output.docx
Anything you see fit