async-zip-stream
v1.1.0
Published
Code to create zip stream from input streams in asynchronous way
Downloads
251
Readme
Async Zip Stream
Helper code to create zip stream from source readable streams. Input streams can be created in lazy manner. Main feature - streams are used sequentially.
Installation
npm i async-zip-stream
Usage
import {createZipStream} from 'async-zip-stream';
const zipSourceStream = createZipStream([
{
name: 'file.txt',
async stream(): Promise<Readable> {
return fs.createReadStream('somefile');
},
}
]);
const destination = fs.createWriteStream('/some/file.zip');
zipSourceStream.on('error', (error) => {
//...
});
destination.on('error', (error) => {
//...
});
destination.on('finish', () => {
//...
});
zipSourceStream.pipe(destination);
Contributing
Fork it, branch it, send me a pull request. We'll work out the rest together.
Author
- Siarhei Ladzeika [email protected]
LICENSE
See LICENSE