diff --git a/README.md b/README.md index a15e676695..45c119a654 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,14 @@ $ 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 diff --git a/ts/export/packer/local.ts b/ts/export/packer/local.ts index 319f2e16f1..d1a5980662 100644 --- a/ts/export/packer/local.ts +++ b/ts/export/packer/local.ts @@ -13,6 +13,7 @@ export class LocalPacker extends Packer { } public pack(path: string): void { + path = path.replace(/.docx$/, ""); this.stream = fs.createWriteStream(`${path}.docx`); super.pack(this.stream); }