How to unpack lo.tar.br using brotli?
Jun711 opened this issue · 1 comments
Jun711 commented
Hi, I tried to use Nodejs brotli to unpack the lo.tar.br file but I am not sure how to use it. After zlib.brotliDecompress
, the tar.br file is still not unpacked.
Could you please provide an example? Thank you
What I tried
const libreOfficePacked = fs.readFileSync('/tmp/lo.tar.br')
zlib.brotliDecompress(libreOfficePacked)
https://nodejs.org/api/zlib.html#zlibbrotlidecompressbuffer-options-callback
zlib.brotliDecompress(buffer[, options], callback)
From brotli npm doc,
// decode a buffer where the output size is known
brotli.decompress(compressedData, uncompressedLength);
// decode a buffer where the output size is not known
brotli.decompress(fs.readFileSync('compressed.bin'));
vladholubiev commented
Here is the example: https://github.com/shelfio/aws-lambda-libreoffice/blob/master/src/unpack.ts