GzipFile
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-testing / GzipFile
Class: GzipFile
A class for compressing and decompressing files using gzip.
Constructorsβ
Constructorβ
new GzipFile(
inputFile,outputFile):GzipFile
Creates a new GzipFile instance.
Parametersβ
inputFileβ
string
The path to the input file to compress/decompress
outputFileβ
string
The path where the compressed file will be saved
Returnsβ
GzipFile
Propertiesβ
inputFileβ
inputFile:
string
The path to the input file
outputFileβ
outputFile:
string
The path to the output file
Methodsβ
compress()β
compress():
Promise<void>
Compresses the input file using gzip compression.
Returnsβ
Promise<void>
A promise that resolves when compression is complete
Throwsβ
If there is an error during compression
decompress()β
decompress():
Promise<string>
Decompresses the input gzip file and returns its contents as a string.
Returnsβ
Promise<string>
A promise that resolves with the decompressed file contents as a string
Throwsβ
If there is an error during decompression