# `ExUtils.Modules`
[🔗](https://github.com/sheharyarn/ex_utils/blob/main/lib/ex_utils/modules.ex#L1)

Generic Elixir utility methods for modules themselves

# `exists?`

```elixir
@spec exists?(module()) :: boolean()
```

Check if a module exists and is compiled

## Example

```elixir
iex> ExUtils.Modules.exists?(Map)
true
iex> ExUtils.Modules.exists?(NonExistentModule)
false
```

# `functions`

```elixir
@spec functions(module()) :: Keyword.t()
```

Returns a Keyword List of all functions of a module.

Calling this will return a `{:atom, arity}` keyword list
of all the functions of that module.

## Example

```elixir
iex> {:flatten, 1} in ExUtils.Modules.functions(List)
true
iex> {:unknown, 2} in ExUtils.Modules.functions(List)
false
```

# `has_function?`

```elixir
@spec has_function?(module(), atom() | {atom(), non_neg_integer()}) :: boolean()
```

Checks if a Module exports a specific function.

First argument must be a Module and the second argument can
either be an `:atom` name of the function or a `{:atom, arity}`
tuple.

## Example

```elixir
iex> ExUtils.Modules.has_function?(Map, :keys)
true
iex> ExUtils.Modules.has_function?(Map, {:keys, 1})
true
iex> ExUtils.Modules.has_function?(Map, {:keys, 2})
false
```

# `has_method?`

> This function is deprecated. Use ExUtils.Modules.has_function?/2 instead.

# `methods`

> This function is deprecated. Use ExUtils.Modules.functions/1 instead.

# `name`

```elixir
@spec name(module()) :: String.t()
```

Returns a String of the Module's name (without the Elixir namespace)

## Example

```elixir
iex> ExUtils.Modules.name(SomeModule)
"SomeModule"
iex> ExUtils.Modules.name(Another.Module)
"Another.Module"
```

---

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