Package Exports
- @yumdocs/yumdocs
- @yumdocs/yumdocs/dist/index.cjs.js
- @yumdocs/yumdocs/dist/index.esm.js
- @yumdocs/yumdocs/dist/index.umd.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yumdocs/yumdocs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Yumdocs
Yumdocs is a template engine for Office documents, including Word, PowerPoint and Excel, in JavaScript environments. It merges documents with data, executing statements and expressions found in tags.
Documentation
Yumdocs is fully documented at https://dev.yumdocs.com.
License and Copyright
This project is MIT Licensed like its 3rd party components:
Copyright (c) 2022 - Jacques L. Chereau. All rights reserved.
Quick Start
Check https://dev.yumdocs.com for browser instructions. The following targets nodeJS.
Prerequisites
Download and install nodeJS v16+ from https://nodejs.org/.
Installation
Create a project directory, make it your working directory, and run:
npm init -y
npm i @yumdocs/yumdocsGetting started
Create a Word document named
input.docx, type{{dummy}}and save it in the project directory.Create a file named
index.mjsand copy paste:
import OpenXMLTemplate from '@yumdocs/yumdocs';
const t = new OpenXMLTemplate();
await t.load('./input.docx');
await t.render({dummy: 'Anything you see fit'});
await t.saveAs('./output.docx');Run
node index.mjs.output.docxhas been generated and the{{dummy}}placeholder has been replaced withAnything you see fit.