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

Merge two lockfiles, preferring entries from the newer lockfile.

Used for workspace scenarios where multiple `package.json` files
produce separate lockfiles that need to be combined.

# `diff`

```elixir
@spec diff(NPM.Lockfile.t(), NPM.Lockfile.t()) ::
  {[String.t()], [String.t()], [{String.t(), String.t(), String.t()}]}
```

Find packages that differ between two lockfiles.

Returns `{added, removed, changed}` where:
- `added` — packages in `newer` but not `base`
- `removed` — packages in `base` but not `newer`
- `changed` — packages in both with different versions

# `merge`

```elixir
@spec merge(NPM.Lockfile.t(), NPM.Lockfile.t()) :: NPM.Lockfile.t()
```

Merge two lockfiles. Entries in `newer` override entries in `base`.

Returns the merged lockfile map.

# `merge`

```elixir
@spec merge(NPM.Lockfile.t(), NPM.Lockfile.t(), function()) :: NPM.Lockfile.t()
```

Merge with a custom conflict resolver.

The `resolver` function receives `(name, base_entry, newer_entry)`
and returns the winning entry.

---

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