async-zip-stream
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Async Zip Stream

Build Status

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

LICENSE

See LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i async-zip-stream

Weekly Downloads

51

Version

1.1.0

License

MIT

Unpacked Size

12.7 kB

Total Files

12

Last publish

Collaborators

  • ladeiko