NPM.Changelog (NPM v0.6.0)

Copy Markdown View Source

Detects and reads changelog files from installed packages.

Supports common changelog file names: CHANGELOG.md, HISTORY.md, CHANGES.md, and their case variations.

Summary

Functions

Finds the changelog file for a package.

Checks if a package has a changelog.

Reads the changelog content for a package.

Extracts the entry for a specific version from markdown changelog.

Lists all versions mentioned in a changelog.

Functions

find(package_dir)

@spec find(String.t()) :: {:ok, String.t()} | :none

Finds the changelog file for a package.

has_changelog?(package_dir)

@spec has_changelog?(String.t()) :: boolean()

Checks if a package has a changelog.

read(package_dir)

@spec read(String.t()) :: {:ok, String.t()} | :none

Reads the changelog content for a package.

version_entry(content, version)

@spec version_entry(String.t(), String.t()) :: String.t() | nil

Extracts the entry for a specific version from markdown changelog.

versions(content)

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

Lists all versions mentioned in a changelog.