• Creates a readable stream for a file transparently handling gzip decompression when required.

    The file is inspected using magic bytes and not the extension to determine whether gzip decompression should be applied. The returned stream is always a Node Readable suitable for consumption by parsing pipelines.

    Parameters

    • options: { filepath: string }

      Options.

      • filepath: string

        Input file path.

    Returns Readable

    A readable stream yielding decompressed or raw file contents.

    If the file cannot be opened or read.