# `VulnCheck.ErlTerm`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/erl_term.ex#L1)

Atom-safe reader for Erlang term files such as `.app`, `.app.src`,
`rebar.lock` and `rebar.config`.

`:file.consult/1` would intern every atom found in third-party files. This
reader instead produces the same neutral representation as
`VulnCheck.Literal`:

  * atoms become `{:atom, "name"}`
  * tuples become `{:tuple, [elements]}`
  * maps become `{:map, [{key, value}]}`
  * strings (`"..."`) and binaries (`<<"...">>`) become Elixir binaries
  * numbers and lists are kept as they are

Only data terms are supported; funs, records with expressions and macros
are rejected with `{:error, reason}`.

# `term_t`

```elixir
@type term_t() ::
  {:atom, String.t()}
  | {:tuple, [term_t()]}
  | {:map, [{term_t(), term_t()}]}
  | [term_t()]
  | binary()
  | number()
```

# `atom_names`

```elixir
@spec atom_names(term()) :: [String.t()]
```

Extracts atom names from a list of atom terms, ignoring other terms.

# `parse`

```elixir
@spec parse(binary()) :: {:ok, [term_t()]} | {:error, String.t()}
```

Parses all dot-terminated terms contained in `source`.

# `parse_file`

```elixir
@spec parse_file(Path.t()) :: {:ok, [term_t()]} | {:error, String.t()}
```

Reads and parses a file of dot-terminated Erlang terms.

# `proplist_get`

```elixir
@spec proplist_get([term_t()] | term_t(), String.t(), term()) :: term()
```

Looks up `key` in a proplist of `{:tuple, [{:atom, key}, value]}` entries.

---

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