NPM.DepPath (NPM v0.6.0)

Copy Markdown View Source

Resolves dependency paths in the node_modules tree.

Summary

Functions

Resolves the .bin directory path.

Resolves a bin executable path.

Checks if a package exists on disk.

Lists all installed packages in node_modules.

Resolves a nested dependency path.

Resolves the package.json path for a package.

Resolves the filesystem path for a package.

Resolves the path for a scoped package.

Functions

bin_dir(node_modules \\ "node_modules")

@spec bin_dir(String.t()) :: String.t()

Resolves the .bin directory path.

bin_path(command, node_modules \\ "node_modules")

@spec bin_path(String.t(), String.t()) :: String.t()

Resolves a bin executable path.

exists?(name, node_modules \\ "node_modules")

@spec exists?(String.t(), String.t()) :: boolean()

Checks if a package exists on disk.

list_installed(node_modules \\ "node_modules")

@spec list_installed(String.t()) :: [String.t()]

Lists all installed packages in node_modules.

nested(parent, child, node_modules \\ "node_modules")

@spec nested(String.t(), String.t(), String.t()) :: String.t()

Resolves a nested dependency path.

package_json(name, node_modules \\ "node_modules")

@spec package_json(String.t(), String.t()) :: String.t()

Resolves the package.json path for a package.

resolve(name, node_modules \\ "node_modules")

@spec resolve(String.t(), String.t()) :: String.t()

Resolves the filesystem path for a package.

scoped_path(name, node_modules \\ "node_modules")

@spec scoped_path(String.t(), String.t()) :: String.t()

Resolves the path for a scoped package.