NPM.Engines (NPM v0.6.0)

Copy Markdown View Source

Parses and analyzes the engines field from package.json.

Summary

Functions

Extracts engines from package.json data.

Checks if a package specifies any engine constraints.

Returns the node version constraint.

Returns the npm version constraint.

Returns the most restrictive node range across packages.

Summarizes engine constraints across all packages.

Returns unknown (non-standard) engine constraints.

Lists all unique engine names used across packages.

Functions

extract(arg1)

@spec extract(map()) :: map()

Extracts engines from package.json data.

has_engines?(data)

@spec has_engines?(map()) :: boolean()

Checks if a package specifies any engine constraints.

node_range(data)

@spec node_range(map()) :: String.t() | nil

Returns the node version constraint.

npm_range(data)

@spec npm_range(map()) :: String.t() | nil

Returns the npm version constraint.

strictest_node(packages)

@spec strictest_node([map()]) :: String.t() | nil

Returns the most restrictive node range across packages.

summary(packages)

@spec summary([map()]) :: map()

Summarizes engine constraints across all packages.

unknown_engines(data)

@spec unknown_engines(map()) :: [String.t()]

Returns unknown (non-standard) engine constraints.

used_engines(packages)

@spec used_engines([map()]) :: [String.t()]

Lists all unique engine names used across packages.