Closed cwtuan closed 1 year ago
const z = zlib.createGzip()
stream.pipe(z)
const z = zlib.createGzip()
const stream = tar.pack()
stream.entry({ name: '/foo/test.txt' }, 'hello');
stream.pipe(z)
stream.finalize();
is it right?
@ralphtheninja
Could you please provide more detail?
I save the file into disk and try to unzip tar -zxvf files.tar.gz
It seems zlib doesn't work.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
The file is still just a tar file becausetar -xvf files.tar.gz
success.
Thanks for your help.
Mind sharing the code you have written this far?
@cwtuan I have written a solution here: https://github.com/mafintosh/tar-stream/issues/24
Now I have a tar stream, how to gz it?