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

    Function sevenZipSync

    • Compresses multiple files into a zipped file synchronously.

      Parameters

      • options: ZipOptions

        An object containing options for the compression process.

      Returns void

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

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

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

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

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