Files
docx-js/ts/export/packer/packer.ts

22 lines
464 B
TypeScript
Raw Normal View History

2016-03-31 18:03:16 +01:00
import {archiver, Zip} from "archiver";
import * as fs from 'fs';
2016-03-31 15:49:42 +01:00
2016-03-31 15:45:48 +01:00
export class Packer {
2016-03-31 18:03:16 +01:00
protected archive: Zip;
constructor() {
this.archive = archiver.create("fgf", {});
}
pack(output: fs.WriteStream): void {
this.archive.pipe(output);
this.archive.bulk([
{
expand: true,
cwd: __dirname + '/template',
src: ['**', '**/.rels']
}
]);
}
2016-03-31 15:45:48 +01:00
}