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

Detect and manage npm lifecycle scripts.

npm packages can define `preinstall`, `install`, `postinstall`,
`prepare`, and other scripts in their `package.json`.

By default, npm_ex does NOT run lifecycle scripts for security.
This module provides detection and opt-in execution.

# `detect`

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

Detect lifecycle scripts in a package's `package.json`.

Returns a list of `{hook_name, command}` tuples for install-related hooks.

# `detect_all`

```elixir
@spec detect_all(String.t()) :: %{required(String.t()) =&gt; [{String.t(), String.t()}]}
```

Detect lifecycle scripts across all packages in `node_modules`.

Returns a map of `package_name => [{hook, command}]` for packages
that have install-related scripts.

# `hook_names`

```elixir
@spec hook_names() :: [String.t()]
```

List the install hook names.

---

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