NodeJs test.
This commit is contained in:
27
test/app.js
Normal file
27
test/app.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var fs = require("fs");
|
||||
var JSZip = require('jszip');
|
||||
let zip = new JSZip()
|
||||
|
||||
new JSZip.external.Promise((resolve, reject)=>{
|
||||
fs.readFile('mythical_man_month__the__essays_on_software_engineering__anniversary_edition.zip',
|
||||
(err, data)=>{
|
||||
if (err){
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
})
|
||||
.then((data)=>{
|
||||
return JSZip.loadAsync(data)
|
||||
})
|
||||
.then((zip)=>{
|
||||
console.log(zip)
|
||||
})
|
||||
.catch((reason)=>{
|
||||
console.log(`Error: ${reason}`)
|
||||
})
|
||||
|
||||
|
||||
|
||||
console.log('test')
|
||||
Reference in New Issue
Block a user