I have a file .tar.gz
, which I have to decompress in a route, but I need to review what is inside it and then unzip it. I have the following code:
const targz = require('targz');
targz.decompress({
src: 'archivo.tar.gz',
dest: 'ruta' //ruta donde se realiza la descompresión ...
}, function(err){
if(err) {
console.log(err);
} else {
console.log("Done!");
}
});
How could I check what contains the tar.gz
before it is unzipped, for example that within a text.txt file, and that I can read that file from within and depending on whatever you say, unzip or not. Thanks in advance