I want to decompress my archive only if there is a certain file inside. So i call unzipper.list() and check the files in unzipper.on('list')
unzipper.on('list', (files) => { if(fileFound(files){ unzipper.extract({path: folderPath}); }) });
If I do it like that, I got the following error:
"fd must be a file descriptor"
If I just call unzipper.extract() from outside the 'list' event, it works fine.