Read compressed files as string and not bitstring

Got it, thanks.
I sorted it with the code below that uses an external library, but I thought if the built-in option could read a compressed file , there might be a way for a built-in to decode it too. I thought there might something simpler that the code below

defmodule FileCounter do
  def words_per_line!(path) do
    # Full path to the xz executable
    xz_path = "/opt/homebrew/bin/xz" # Adjust this path based on where xz is installed on your system

    # Use `xz` command to decompress the file content in memory
    {decompressed_content, 0} = System.cmd(xz_path, ["-dc", path])

    # Process the decompressed content
    decompressed_content
    |> String.split("\n", trim: true)
    |> Enum.each(&IO.puts/1)
  end
end