NPM.GitInfo (NPM v0.6.0)

Copy Markdown View Source

Extracts git metadata for npm packages.

Reads repository, bugs, and homepage URLs from package.json and generates common URLs (issues, PRs, compare, etc.).

Summary

Functions

Generates a compare URL for two versions.

Checks if the package is hosted on GitHub.

Extracts the GitHub user/repo from package data.

Returns the homepage URL.

Returns the issues URL for a package.

Extracts git repository URL from package data.

Functions

compare_url(data, from_version, to_version)

@spec compare_url(map(), String.t(), String.t()) :: String.t() | nil

Generates a compare URL for two versions.

github?(data)

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

Checks if the package is hosted on GitHub.

github_repo(data)

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

Extracts the GitHub user/repo from package data.

homepage(data)

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

Returns the homepage URL.

issues_url(data)

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

Returns the issues URL for a package.

repo_url(arg1)

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

Extracts git repository URL from package data.