docx-stream-template

1.0.3 • Public • Published

docx-stream-template

Simple stream template engine for create docx files in NodeJS

Install

npm i --save docx-stream-template

Use

Add to your docx file constructions like that:

Hello dear {{anotherBoringVariableName}}!
Good bye!

Then just call template function:

const template = require('docx-stream-template');
 
template({
  anotherBoringVariableName: 'Bulochka',
}, fs.createReadStream(path.join(__dirname, './test.docx'))).
pipe(fs.createWriteStream(path.join(__dirname, './donetest.docx')));

The first parameter of template function is object with variables, what you can use in the docx file.

Thats all!

Package Sidebar

Install

npm i docx-stream-template

Weekly Downloads

3

Version

1.0.3

License

MIT

Last publish

Collaborators

  • ya-kostik