@xingrz/decompress .zip plugin.
npm install --save @xingrz/decompress-unzip
import decompress from '@xingrz/decompress';
import decompressUnzip from '@xingrz/decompress-unzip';
(async () => {
await decompress('unicorn.zip', 'dist', {
plugins: [
decompressUnzip()
]
});
console.log('Files decompressed');
})();
Returns a Promise<File[]>
.
Type: Buffer
or stream.Readable
Buffer or stream to decompress.
Note: Although input of stream is supported, ZIP format itself doesn't support extracting in stream. This means memory consumption should be considered.