cross-7zip - v1.2.0
    Preparing search index...

    Function sevenZip

    • Compresses multiple files into a zipped file asynchronously.

      Parameters

      • options: ZipOptions

        An object containing options for the compression process.

      Returns Promise<void>

      Will throw an error if the 7-Zip executable is not found.

      import { ZipOptions, sevenZip } from 'cross-7zip';

      async function createArchive(): Promise<void> {
      try {
      const zipOptions: ZipOptions = {
      destination: 'example.7z',
      files: ['document.txt', 'image.png', 'folder']
      };

      await sevenZip(zipOptions);
      console.log('Archive created successfully.');
      } catch (error) {
      console.error('An error occurred during compression:', error);
      }
      }

      For additional examples, see the sevenZipUnzip.test.ts.