Test node js app to load a zip file.
This commit is contained in:
@@ -3,7 +3,7 @@ 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',
|
||||
fs.readFile('test/mythical_man_month__the__essays_on_software_engineering__anniversary_edition.zip',
|
||||
(err, data)=>{
|
||||
if (err){
|
||||
reject(err);
|
||||
@@ -13,10 +13,15 @@ new JSZip.external.Promise((resolve, reject)=>{
|
||||
})
|
||||
})
|
||||
.then((data)=>{
|
||||
return JSZip.loadAsync(data)
|
||||
return JSZip.loadAsync(data, {
|
||||
checkCRC32: true
|
||||
})
|
||||
})
|
||||
.then((zip)=>{
|
||||
console.log(zip)
|
||||
zip.folder('EPUB').forEach((fileName, _)=>{
|
||||
console.log(`${fileName}`)
|
||||
})
|
||||
})
|
||||
.catch((reason)=>{
|
||||
console.log(`Error: ${reason}`)
|
||||
|
||||
Reference in New Issue
Block a user