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

Support for registry mirror URLs and fallback.

Configure mirrors for faster downloads from geographically
closer servers, with automatic fallback to the primary registry.

# `get_mirror`

```elixir
@spec get_mirror(String.t()) :: String.t() | nil
```

Get a specific mirror URL by name.

# `known_mirror?`

```elixir
@spec known_mirror?(String.t()) :: boolean()
```

Check if a URL is a known mirror.

# `known_mirrors`

```elixir
@spec known_mirrors() :: %{required(String.t()) =&gt; String.t()}
```

List known mirror names and URLs.

# `mirror_url`

```elixir
@spec mirror_url() :: String.t()
```

Get the configured mirror URL, or the default registry.

# `rewrite_tarball_url`

```elixir
@spec rewrite_tarball_url(String.t(), String.t()) :: String.t()
```

Rewrite a tarball URL to use a mirror.

Replaces the registry hostname with the mirror hostname.

---

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