compressFile
compressFile(
src,dest?,options?):Promise<PathLike>
Defined in: packages/node/src/fs/compress-file.ts:61
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
Section titled “Parameters”PathLike
The path to the source file.
PathLike | null
The path to the destination file. If omitted, it will be generated by appending the appropriate file extension to the source file path.
options?
Section titled “options?”Compression options.
Returns
Section titled “Returns”Promise<PathLike>
The path to the compressed file.