Merge branch 'master' into image-support
This commit is contained in:
@ -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
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user