New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

patch-data

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

patch-data

A tool to replace placeholders in Word documents with Excel data

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Patch Data Tool

A Node.js tool to replace placeholders in Word documents with data from Excel files.

Features

  • Automatically detects placeholders in Word documents (marked with $ prefix)
  • Reads data from Excel files and replaces corresponding placeholders
  • Generates new Word documents with replaced content

Installation

  • Clone this repository
  • Install dependencies:
npm install

Usage

1. Prepare Files

  • Place your Word template (with $-prefixed placeholders) in the project root as template.docx
  • Place your Excel file (with data) in the project root as data.xlsx

2. Run the Tool

npm start

Configuration

You can modify the file paths in index.js if you need to use different file names or locations:

// In index.js
const CONFIG = {
  excelPath: path.join(__dirname, 'your_data.xlsx'),
  wordTemplatePath: path.join(__dirname, 'your_template.docx'),
  outputDir: path.join(__dirname, 'custom_output')
}

Example

Excel File (data.xlsx):

nameagecompany
Alice30Tech Corp
Bob28Design Studio

Word Template (template.docx) content: "Hello $name, you work at $company and are $age years old."

Output Files:

  • output_1.docx
  • output_2.docx

Each output file will contain the replaced content from corresponding Excel rows.

FAQs

Package last updated on 26 Jun 2025

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