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

Provides statistics about the npm package cache.

# `disk_size`

```elixir
@spec disk_size() :: non_neg_integer()
```

Estimates cache size on disk.

# `format`

```elixir
@spec format(map()) :: String.t()
```

Formats cache statistics for display.

# `format_size`

```elixir
@spec format_size(non_neg_integer()) :: String.t()
```

Formats a byte size in human-readable form.

# `hit_miss`

```elixir
@spec hit_miss(map()) :: %{
  hits: non_neg_integer(),
  misses: non_neg_integer(),
  total: non_neg_integer()
}
```

Computes cache hit/miss statistics for a lockfile.

# `hit_rate`

```elixir
@spec hit_rate(map()) :: float()
```

Computes the hit rate as a percentage.

# `list_cached`

```elixir
@spec list_cached() :: [{String.t(), [String.t()]}]
```

Lists cached packages with versions.

---

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