Closed jadams2305 closed 1 year ago
Yes, i did it like that
const tar = require('tar-stream');
function main(rawTar) {
const extract = tar.extract();
const pack = tar.pack();
const readStream = Readable.from(rawTar);
extract.on('entry', function (header, stream, callback) {
if (header.name.match(/your-match-pattern/)) {
header.name = header.name.replace(/your-pattern/, '');
}
stream.pipe(pack.entry(header, callback));
})
extract.on('finish', function () {
pack.finalize();
})
readStream.pipe(extract);
}
Is it possible to remove/delete a file in the tar?
Like https://www.gnu.org/software/tar/manual/html_node/delete.html
Thank you