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

20 lines
439 B
TypeScript
Raw Normal View History

2018-07-01 02:16:11 +01:00
import { File } from "../../file";
import { BufferStream } from "./buffer-stream";
import { Compiler } from "./compiler";
export class BufferPacker {
private readonly packer: Compiler;
constructor(file: File) {
this.packer = new Compiler(file);
}
public async pack(): Promise<Buffer> {
const stream = new BufferStream();
await this.packer.compile(stream);
return stream.Buffer;
}
}