The path to the source file.
Optionaldest: PathLike | nullThe path to the destination file. If omitted, it will be generated by appending the appropriate file extension to the source file path.
Optionaloptions: CompressFileOptionsCompression options.
The path to the compressed file.
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
keepSourceoption totrue.Supported compression algorithms are Brotli, Gzip, and Zstd.