happy-opfs
    Preparing search index...

    Function unzipFromUrl

    • Unzip a remote 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 unzipStreamFromUrl instead.

      Use fflate as the unzip backend.

      This API is built on @happy-ts/fetch-t for downloading the zip file. options supports timeout and onProgress options.

      Parameters

      • zipFileUrl: string | URL

        Zip file url.

      • destDir: string

        The directory to unzip to.

      • OptionalrequestInit: FsRequestInit

        Optional request options.

      Returns AsyncVoidIOResult

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

      1.7.0

      (await unzipFromUrl('https://example.com/archive.zip', '/extracted'))
      .inspect(() => console.log('Remote zip file unzipped successfully'));

      // With timeout
      (await unzipFromUrl('https://example.com/archive.zip', '/extracted', { timeout: 5000 }))
      .inspect(() => console.log('Remote zip file unzipped successfully'));