1.1.0 • Published 2 years ago

@forthlaw/docx v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@forthlaw/docx

Environment Variables

Methods

generateDocument({ inputFilepath, contents, outputFilepath, dataset })
allDocumentFields({ inputFilepath, contents })

inputFilepath and outputFilepath are both local filepaths to docx files, which both include the file extension. allDocumentFields provides a list of fields available in the input docx file, while generateDocument actually generates the new document with your provided dataset. dataset is a JS object of data. The existence of inputFilepath will force the script to load that filepath and override any contents that may be provided. Optionally, can simply provide contents, for instance via S3 downloaded object, to simply use what's in memory, instead of keeping a tmp copy locally.