I have a file .tar.gz
, which I have to unzip in a path, but I need to check what is inside it to later 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!");
}
});
As I could review what it contains before it is decompressed, for example that there is a text.txttar.gz
file inside , and that I can read that file from inside and depending on what it says, I decompress or not. Thanks in advance