Function encodeSvg

  • Encodes an SVG file, optimizes it, and saves it to a destination directory.

    Parameters

    • srcFilename: string

      The path to the SVG file.

    • distFileName: string

      The path to the destination file.

    • options: SVGCompressionOption

      Optional Svgo plugin configurations.

    Returns Promise<OutputData>

    A promise that resolves with the metadata of the optimized image.