happy-opfs
    Preparing search index...

    Function zipSync

    Synchronous version of zip. Zips a file or directory.

    The path to zip.

    Optional destination zip file path or options.

    Optional zip options.

    An IOResult containing the result.

    zip for the async version.

    1.6.0

    • Synchronous version of zip. Zips a file or directory and writes to a zip file.

      Parameters

      • sourcePath: string

        The path to zip.

      • zipFilePath: string

        The destination zip file path.

      • Optionaloptions: ZipOptions

        Optional zip options.

      Returns VoidIOResult

      A VoidIOResult indicating success or failure.

      zip for the async version.

      1.6.0

      zipSync('/documents', '/backups/documents.zip');
      
    • Synchronous version of zip. Zips a file or directory and returns the zip data.

      Parameters

      • sourcePath: string

        The path to zip.

      • Optionaloptions: ZipOptions

        Optional zip options.

      Returns IOResult<Uint8Array<ArrayBuffer>>

      An IOResult containing the zip data as Uint8Array.

      zip for the async version.

      1.6.0

      zipSync('/documents')
      .inspect(data => console.log('Zip size:', data.byteLength));