# `Lei.Cache.Exporter`
[🔗](https://github.com/gtri/lowendinsight/blob/main/lib/cache/exporter.ex#L5)

Exports LEI analysis reports as cache snapshot files.

Generates two files in an export directory:
- `manifest.json` - Metadata about the cache snapshot
- `cache.jsonl.gz` - Gzipped JSONL of analysis reports

These files can then be packaged as an OCI artifact via `Lei.Cache.OCI`.

# `export`

```elixir
@spec export([map()], String.t(), keyword()) ::
  {:ok, String.t()} | {:error, String.t()}
```

Exports a list of analysis reports to the given directory.

Each report should be a map as returned by `AnalyzerModule.analyze/3`.
Creates `manifest.json` and `cache.jsonl.gz` in `output_dir`.

# `read_jsonl`

```elixir
@spec read_jsonl(String.t()) :: {:ok, [map()]} | {:error, String.t()}
```

Reads analysis reports from a JSONL file (plain or gzipped).

# `reports_to_jsonl`

```elixir
@spec reports_to_jsonl([map()]) :: binary()
```

Converts a list of reports to newline-delimited JSON (JSONL).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
