@ac-essentials/misc-util
    Preparing search index...

    Function compressFile

    • Compress a file using the specified compression algorithm.

      The destination file path can be omitted, in which case it will be generated by appending the appropriate file extension to the source file path.

      By default, the source file will be deleted after compression. This can be changed by setting the keepSource option to true.

      Supported compression algorithms are Brotli, Gzip, and Zstd.

      Parameters

      • src: PathLike

        The path to the source file.

      • Optionaldest: null | PathLike

        The path to the destination file. If omitted, it will be generated by appending the appropriate file extension to the source file path.

      • Optionaloptions: CompressFileOptions

        Compression options.

      Returns Promise<PathLike>

      The path to the compressed file.