I'm trying to stream a targz file and then stream the unzipped file inside so I can read that file line by line. This is already a bit of an experiment for me to see if I can get this working. I think I should be using tar.Parse for this but I'm getting the following error:
TypeError: invalid base256 encoding
This is my code:
async function unzip (path) {
return new Promise((resolve, reject) => {
const stream = fs.createReadStream(path)
const parser = new tar.Parse({
filter: function (path) {
console.log(path);
return path === 'itunes20190710/song_mix'
},
onentry: function (entry) {
console.log(entry) // Never gets here
resolve()
}
})
stream.pipe(parser)
})
}
I'm trying to stream a targz file and then stream the unzipped file inside so I can read that file line by line. This is already a bit of an experiment for me to see if I can get this working. I think I should be using
tar.Parse
for this but I'm getting the following error:This is my code:
You can find the file I'm working with here
Am I doing something wrong here or is the file not in the right format?