Function getImageCompressionOptions

  • This function prompts the user for settings to compress different image formats, including SVG files with custom SVGO plugins.

    Parameters

    • imageFormats: string[]

      An array of image file formats (e.g. ['.jpg', '.png', '.svg']) that the function will prompt the user about compressing.

    • verbose: boolean = false

      Whether to log messages

    Returns Promise<{
        [key in InputFormats]: CompressionOption
    }>

    an object containing compression settings for different image formats. The settings are obtained through a series of prompts that ask the user whether they want to compress each format, which compressor to use (if applicable), and the quality level (if applicable). For SVG files, the user can also choose which SVGO plugins to use for compression.