How to use archiver

Comprehensive archiver code examples:

How to use archiver.create:

13
14
15
16
17
18
19
20
21

## Usage

```js
var archiver = require('archiver');
var archive = archiver.create('zip', {}); // or archiver('zip', {});
```

## Formats

How to use archiver.registerFormat:

36
37
38
39
40
41
42
43
44
45

s3Zip.archiveStream = function (stream, filesS3, filesZip) {
  const self = this
  const folder = this.folder || ''
  if (this.registerFormat) {
    archiver.registerFormat(this.registerFormat, this.formatModule)
  }
  const archive = archiver(this.format || 'zip', this.archiverOpts || {})
  archive.on('error', function (err) {
    self.debug && console.log('archive error', err)