Home Reference Source
import GzipDetector from 'node-warc/lib/parsers/gzipDetector.js'
public class | source

GzipDetector

Utility class that provides the means to detect if a file is gzipped or not

Static Method Summary

Static Public Methods
public static

async isGzipped(filePath: string): Promise<boolean>

Determines if a file is gzipped or not by reading its the magic number

public static

Synchronous version of isGzipped

Static Public Methods

public static async isGzipped(filePath: string): Promise<boolean> source

Determines if a file is gzipped or not by reading its the magic number

Params:

NameTypeAttributeDescription
filePath string

path to the file to detect

Return:

Promise<boolean>

Promise that resolves to true if the file is gzipped false otherwise

Throw:

Error

if the filePath is null or undefined or if another error occurred

public static isGzippedSync(filePath: string): boolean source

Synchronous version of isGzipped

Params:

NameTypeAttributeDescription
filePath string

path to the file to detect

Return:

boolean

true if the file is gzipped false otherwise

Throw:

Error

if the filePath is null or undefined or if another error occurred