Merge branch 'master' into image-support

This commit is contained in:
Dolan Miu
2017-03-12 21:44:17 +00:00
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,14 @@
$ npm install --save docx $ npm install --save docx
``` ```
# Demo
```sh
$ npm run demo
```
will run the demo app in the `demo` folder, which creates a file called "My Document.docx" in the root of the project
# Usage # Usage

View File

@ -13,6 +13,7 @@ export class LocalPacker extends Packer {
} }
public pack(path: string): void { public pack(path: string): void {
path = path.replace(/.docx$/, "");
this.stream = fs.createWriteStream(`${path}.docx`); this.stream = fs.createWriteStream(`${path}.docx`);
super.pack(this.stream); super.pack(this.stream);
} }