happy-opfs
    Preparing search index...

    Function zipStream

    • Zip a file or directory using streaming compression. Equivalent to zip -r <zipFilePath> <sourcePath>.

      This function processes files sequentially with streaming read/write, minimizing memory usage. Recommended for large directories or files. For better speed with small files, consider using zip instead.

      Use fflate as the zip backend.

      Parameters

      • sourcePath: string

        The path to be zipped.

      • zipFilePath: string

        The path to the zip file.

      • Optionaloptions: ZipOptions

        Options of zip.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncIOResult indicating whether the source was successfully zipped.

      2.0.0

      • zip for batch version (faster for small files)
      • unzipStream for the reverse operation
      // Stream zip a large directory
      (await zipStream('/large-documents', '/backups/documents.zip'))
      .inspect(() => console.log('Directory zipped successfully'));