NPM.InstallStrategy (NPM v0.6.0)

Copy Markdown View Source

Determines and configures package installation strategy.

npm supports hoisted (default), nested, and isolated install strategies configured via .npmrc or --install-strategy flag.

Summary

Functions

Describes a strategy.

Detects the install strategy from config.

Returns the node_modules structure depth for a strategy.

Returns recommended strategy for a project configuration.

Returns all supported strategies.

Checks if a strategy is valid.

Functions

describe(arg1)

@spec describe(atom()) :: String.t()

Describes a strategy.

detect(config)

@spec detect(map()) :: atom()

Detects the install strategy from config.

max_depth(arg1)

@spec max_depth(atom()) :: non_neg_integer() | :infinity

Returns the node_modules structure depth for a strategy.

recommend(pkg_data)

@spec recommend(map()) :: atom()

Returns recommended strategy for a project configuration.

strategies()

@spec strategies() :: [atom()]

Returns all supported strategies.

valid?(strategy)

@spec valid?(atom()) :: boolean()

Checks if a strategy is valid.