-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoczip.js
33 lines (22 loc) · 921 Bytes
/
doczip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var fs = require('fs')
// const fs = require('fs');
// const JSZip = require("jszip");
// import JSZip from 'jszip'
export default doczip = async () => {
// var path = 'C:/Work/vuejs/hitch/makedoc/download';
fs.writeFile('download/mynewfile3.txt', 'This is my text', function (err) {
if (err) throw err;
console.log('Replaced!');
});
// Initialise the zip file
// const zip = new JSZip();
// Make a new text file with the text Hello World
// zip.file(`${this.heading}.pdf`, doc);
// Make a new folder called images with a picture called shapes
// const documents = zip.folder("documents");
// zip.folder("filder").file("hello.txt", "Hello World\n");
// // Convert the zip file into a buffer
// const content = await zip.generateAsync({ type: "nodebuffer" });
// // Save the zip file
// fs.writeFileSync("example.zip", content);
})();