How to use the archiver.default function in archiver

To help you get started, we’ve selected a few archiver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iopipe / iopipe-js-profiler / src / index.js View on Github external
return new Promise(resolve => {
      try {
        const archive = archiver.default('zip');

        /* NodeJS's Buffer has a fixed-size heap allocation.

           Here an Array, which has dynamic allocation,
           is used to buffer (hold) data received from a stream
           then used to construct a Buffer via Buffer.concat(Array),
           a constructor of Buffer. */
        const archiveBuffer = [];
        const heapSnapshotBufferArr = [];

        archive.on('data', chunk => archiveBuffer.push(chunk));
        archive.on('finish', async () => {
          /* Here uploads to S3 are incompatible with streams.
             Chunked Encoding is not supported for uploads
             to a pre-signed url. */
          await request({

archiver

a streaming interface for archive generation

MIT
Latest version published 9 months ago

Package Health Score

87 / 100
Full package analysis