Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ya-kostik/docx-stream-template
Simple stream template engine for create docx files in NodeJS
https://github.com/ya-kostik/docx-stream-template
docx node nodejs stream template variables
Last synced: about 1 month ago
JSON representation
Simple stream template engine for create docx files in NodeJS
- Host: GitHub
- URL: https://github.com/ya-kostik/docx-stream-template
- Owner: ya-kostik
- License: mit
- Created: 2017-04-15T15:46:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-18T15:21:50.000Z (over 7 years ago)
- Last Synced: 2024-09-15T22:39:27.499Z (3 months ago)
- Topics: docx, node, nodejs, stream, template, variables
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```javascript
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!