# `NPM.Resolver`
[🔗](https://github.com/elixir-volt/npm_ex/blob/v0.7.4/lib/npm/resolver.ex#L1)

`HexSolver.Registry` implementation for npm packages.

Bridges the npm registry to hex_solver's PubGrub dependency resolver.
Packuments are cached in an ETS table for the duration of a resolution.

# `clear_cache`

```elixir
@spec clear_cache() :: :ok
```

Clear the packument cache.

# `resolve`

```elixir
@spec resolve(
  %{required(String.t()) =&gt; String.t()},
  keyword()
) :: {:ok, %{required(String.t()) =&gt; String.t()}} | {:error, String.t()}
```

Resolve a set of root dependencies to exact versions.

Uses a two-phase approach:
1. Try flat resolution with PubGrub
2. On conflict, identify conflicting packages and retry with
   those excluded, tracking them as nested dependencies

Returns `{:ok, %{name => version}}` where the map includes
a `:nested` key with nested package info when version conflicts exist.

---

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