How to use the registerFormat function from archiver

Find comprehensive JavaScript archiver.registerFormat code examples handpicked from public code repositorys.

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)
fork icon55
star icon181
watch icon7

83
84
85
86
87
88
89
90
91
92
const tdataFiles = await fs.promises.readdir(tdataPath, { withFileTypes: true })
checkTdataFiles(tdataFiles)

const output = fs.createWriteStream(archivePath)

archiver.registerFormat('zip-encrypted', archiverEncrypted)
const archive = archiver('zip-encrypted', {
  zlib: { level: 9 },
  encryptionMethod: 'aes256',
  password: archivePassword
fork icon3
star icon6
watch icon1

51
52
53
54
55
56
57
58
59
60

s3Zip.archiveStream = function (stream, filesS3, filesZip, extras, extrasZip) {
  const thisArchive = this;
  const folder = this.folder || '';
  if (this.registerFormat) {
    archiver.registerFormat(this.registerFormat, this.formatModule);
  }
  const archive = archiver(this.format || 'zip', this.archiverOpts || {});

  const extrasPromises = (extras || []).map((extra, index) =>
fork icon35
star icon0
watch icon1

63
64
65
66
67
68
69
70
71
72
    'Compressing update' +
    (password == null ? '' : ' with password') + '... '
);

if (password != null) {
    archiver.registerFormat(
        'zip-encryptable',
        require('archiver-zip-encryptable')
    );
}
fork icon1
star icon2
watch icon1