happy-opfs
    Preparing search index...

    Function unzip

    • Unzip a zip file to a directory using batch decompression. Equivalent to unzip -o <zipFilePath> -d <destDir>

      This function loads the entire zip file into memory before decompression. Faster for small files (<5MB). For large files, consider using unzipStream instead.

      Use fflate as the unzip backend.

      Parameters

      • zipFilePath: string

        Zip file path.

      • destDir: string

        The directory to unzip to.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncIOResult indicating whether the zip file was successfully unzipped.

      1.6.0

      • unzipSync for synchronous version
      • unzipStream for streaming version (better for large files)
      • zip for the reverse operation
      (await unzip('/downloads/archive.zip', '/extracted'))
      .inspect(() => console.log('Unzipped successfully'));