@hyperfrontend/versioning/changelog

Changelog Module

The changelog module provides comprehensive parsing, manipulation, and serialization of CHANGELOG.md files.

Architecture Overview

Module Dependencies

Data Model

Parse Pipeline

Section Types

The module recognizes these standard changelog section types:

TypeCommon Headings
breakingBreaking Changes, BREAKING
featuresFeatures, Added, New
fixesBug Fixes, Fixed
performancePerformance, Perf
documentationDocumentation, Docs
deprecationsDeprecated
refactoringRefactored, Refactor
testsTests, Testing
buildBuild, Dependencies
ciCI, Continuous Integration
choresChores, Misc
otherOther (fallback)

Usage Examples

Parsing a Changelog

import { parseChangelog } from '@hyperfrontend/versioning'

const markdown = `
# Changelog

## [1.0.0] - 2024-01-15

### Features
- Initial release
`

const changelog = parseChangelog(markdown)

Creating a Changelog Programmatically

import { createChangelog, createChangelogEntry, createChangelogSection, createChangelogItem } from '@hyperfrontend/versioning'

const changelog = createChangelog({
  header: { title: '# Changelog', description: [], links: [] },
  entries: [
    createChangelogEntry('1.0.0', {
      date: '2024-01-15',
      sections: [createChangelogSection('features', 'Features', [createChangelogItem('Initial release')])],
    }),
  ],
  metadata: { format: 'keep-a-changelog', isConventional: false, warnings: [] },
})

Serializing to Markdown

import { serializeChangelog } from '@hyperfrontend/versioning'

const markdown = serializeChangelog(changelog, {
  includeScope: true,
  useAsterisks: false,
})

Comparing Changelogs

import { isChangelogEqual, diffChangelogs } from '@hyperfrontend/versioning'

const areEqual = isChangelogEqual(changelog1, changelog2)
const diff = diffChangelogs(changelog1, changelog2)

Filtering Entries

import { filterByVersionRange, filterBreakingChanges } from '@hyperfrontend/versioning'

const recent = filterByVersionRange(changelog, '1.0.0', '2.0.0')
const breaking = filterBreakingChanges(changelog)

Merging Changelogs

import { mergeChangelogs } from '@hyperfrontend/versioning'

const result = mergeChangelogs(source, target, {
  entryStrategy: 'union',
  sectionStrategy: 'union',
  itemStrategy: 'union',
})

Transforming Entries

import { transformEntries, sortEntries, compact } from '@hyperfrontend/versioning'

const updated = transformEntries(changelog, (entry) => ({
  ...entry,
  date: entry.date ?? new Date().toISOString().split('T')[0],
}))

const sorted = sortEntries(updated)
const cleaned = compact(sorted)

Merge Strategies

StrategyEntry BehaviorSection BehaviorItem Behavior
sourceUse source entryUse source sectionUse source item
targetUse target entryUse target sectionUse target item
unionInclude both (unique)Combine sectionsCombine items
latestUse newer entryMerge by typeReplace by description

Design Principles

  1. Immutability: All operations return new objects; inputs are never mutated
  2. No Regex: Character-by-character parsing to prevent ReDoS vulnerabilities
  3. Functional: Pure functions without class-based state
  4. Lossless: Round-trip parsing preserves original formatting where possible
  5. Type-Safe: Full TypeScript support with strict typing

See Also

API Reference§

ƒ Functions

§function

addEntry(changelog: Changelog, entry: ChangelogEntry, options?: AddEntryOptions): Changelog

Adds a new entry to a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to add to
§entry
ChangelogEntryThe entry to add
§options?
AddEntryOptionsOptional add options
Returns
Changelog
A new changelog with the entry added
Example

Adding a new entry to a changelog

const newChangelog = addEntry(changelog, {
  version: '1.2.0',
  date: '2024-01-15',
  unreleased: false,
  sections: [...]
})
§function

addItemToEntry(changelog: Changelog, version: string, sectionType: string, item: ChangelogItem): Changelog

Adds an item to a specific section within an entry.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog containing the entry to modify
§version
stringThe version identifier of the entry to update
§sectionType
stringCategory identifier for grouping changes (e.g., 'features', 'fixes')
§item
ChangelogItemDescription of the change with optional scope and metadata
Returns
Changelog
A new changelog with the item added
Example

Adding a feature item to an entry

const item = { description: 'Add dark mode support', scope: 'ui' }
const updated = addItemToEntry(changelog, '1.2.0', 'features', item)
// Item added to the features section of version 1.2.0
§function

addUnreleasedEntry(changelog: Changelog, sections: unknown): Changelog

Adds or updates an unreleased entry.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to add the unreleased entry to
§sections
unknownSections to include in the unreleased entry
Returns
Changelog
A new changelog with unreleased entry added/updated
Example

Adding an unreleased entry with sections

const sections = [createChangelogSection('features', 'Added', [item])]
const updated = addUnreleasedEntry(changelog, sections)
// => Changelog with unreleased entry at the top
§function

appendChangelog(source: Changelog, target: Changelog, position: "start" | "end"): Changelog

Appends entries from target to source (no conflict resolution).
Parameters
NameTypeDescription
§source
ChangelogThe base changelog to append to
§target
ChangelogThe changelog whose entries will be appended
§position
"start" | "end"Where to insert ('start' or 'end')(default: 'end')
Returns
Changelog
A new changelog with combined entries
Example

Appending entries to a changelog

const combined = appendChangelog(mainChangelog, newChangelog, 'start')
// newChangelog entries appear before mainChangelog entries
§function

checkSchemaCompatibility(source: Changelog, target: Changelog): CompatibilityResult

Checks if two changelogs have compatible schemas. Used to detect format incompatibilities before merge/compare.
Parameters
NameTypeDescription
§source
ChangelogThe source changelog
§target
ChangelogThe target changelog
Returns
CompatibilityResult
Compatibility result with any differences found
Example

Checking schema compatibility before merge

const result = checkSchemaCompatibility(mainChangelog, branchChangelog)
if (!result.compatible) {
  console.log('Schema differences:', result.differences)
}
§function

cloneChangelog(changelog: Changelog): Changelog

Clones a changelog deeply (for modification without affecting original).
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to clone
Returns
Changelog
A deep copy of the changelog
Example

Cloning a changelog

const copy = cloneChangelog(changelog)
// Independent deep copy, safe to mutate
§function

combineChangelogs(changelogs: unknown, options?: MergeOptions): Changelog

Combines multiple changelogs into one.
Parameters
NameTypeDescription
§changelogs
unknownArray of changelogs to combine
§options?
MergeOptionsOptional merge options
Returns
Changelog
The combined changelog
Example

Combining multiple changelogs

const unified = combineChangelogs([pkg1Changelog, pkg2Changelog], {
  strategy: 'merge-sections',
})
// All entries from both changelogs merged with conflict resolution
§function

compact(changelog: Changelog, keepUnreleased: boolean): Changelog

Compacts a changelog by removing empty sections and entries.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to compact
§keepUnreleased
booleanWhether to keep empty unreleased entry (default: true)(default: true)
Returns
Changelog
A new compacted changelog
Example

Compacting a changelog

const compacted = compact(changelog)
// Empty sections and entries removed (unreleased kept)

const strict = compact(changelog, false)
// Even empty unreleased entry is removed
§function

createChangelog(options?: Partial<Changelog>): Changelog

Creates a new changelog with default values.
Parameters
NameTypeDescription
§options?
Partial<Changelog>Optional configuration to customize the changelog
Returns
Changelog
A new Changelog object with the specified options or defaults
Example

Creating a changelog with custom source

const changelog = createChangelog({ source: 'CHANGELOG.md' })
// => { source: 'CHANGELOG.md', header: { title: '# Changelog', ... }, entries: [] }
§function

createChangelogEntry(version: string, options?: Partial<Omit<ChangelogEntry, "version">>): ChangelogEntry

Creates a new changelog entry.
Parameters
NameTypeDescription
§version
stringThe version string (e.g., '1.0.0')
§options?
Partial<Omit<ChangelogEntry, "version">>Optional configuration for date, sections, and other properties
Returns
ChangelogEntry
A new ChangelogEntry object
Example

Creating a changelog entry with date and sections

const entry = createChangelogEntry('1.0.0', {
  date: '2024-01-15',
  sections: [createChangelogSection('features', 'Added', items)],
})
§function

createChangelogItem(description: string, options?: Partial<Omit<ChangelogItem, "description">>): ChangelogItem

Creates a new changelog item.
Parameters
NameTypeDescription
§description
stringThe description text of the change
§options?
Partial<Omit<ChangelogItem, "description">>Optional configuration for scope, commits, references, and breaking flag
Returns
ChangelogItem
A new ChangelogItem object
Example

Creating a changelog item with options

const item = createChangelogItem('Add user authentication', {
  scope: 'auth',
  breaking: false,
  references: [{ number: 42, type: 'issue' }],
})
§function

createChangelogSection(type: ChangelogSectionType, heading: string, items: unknown): ChangelogSection

Creates a new changelog section.
Parameters
NameTypeDescription
§type
ChangelogSectionTypeThe type of section (features, fixes, breaking, etc.)
§heading
stringThe display heading for the section
§items
unknownOptional array of changelog items in this section(default: [])
Returns
ChangelogSection
A new ChangelogSection object
Example

Creating a features section with items

const section = createChangelogSection('features', 'Added', [
  createChangelogItem('New dashboard widget'),
])
§function

createCommitRef(hash: string, url?: string): CommitRef

Creates a commit reference from a full hash.
Parameters
NameTypeDescription
§hash
stringThe full commit hash
§url?
stringOptional URL to the commit
Returns
CommitRef
A new CommitRef object with both full and short hash
Example

Creating a commit reference

const ref = createCommitRef('abc1234def5678', 'https://github.com/org/repo/commit/abc1234def5678')
// => { hash: 'abc1234def5678', shortHash: 'abc1234', url: 'https://...' }
§function

createEmptyChangelog(): Changelog

Creates a new empty changelog with standard header.
Returns
Changelog
A new empty Changelog with Keep a Changelog format
Example

Creating an empty changelog with standard header

const changelog = createEmptyChangelog()
// => Changelog with standard Keep a Changelog header and no entries
§function

createIssueRef(number: number, type: "issue" | "pull-request", url?: string): IssueRef

Creates an issue reference.
Parameters
NameTypeDescription
§number
numberThe issue or PR number
§type
"issue" | "pull-request"The type of reference ('issue' or 'pull-request')(default: 'issue')
§url?
stringOptional URL to the issue or PR
Returns
IssueRef
A new IssueRef object
Example

Creating issue and PR references

const issueRef = createIssueRef(42, 'issue', 'https://github.com/org/repo/issues/42')
// => { number: 42, type: 'issue', url: 'https://...' }

const prRef = createIssueRef(123, 'pull-request')
// => { number: 123, type: 'pull-request', url: undefined }
§function

createSpacing(count: number, lineEnding: string): string

Creates blank lines for spacing.
Parameters
NameTypeDescription
§count
numberNumber of blank lines
§lineEnding
stringLine ending style
Returns
string
String with specified number of blank lines
Example

Creating blank line spacing

createSpacing(2, '\n')
// => '\n\n'
§function

createUnreleasedEntry(sections: unknown): ChangelogEntry

Creates an unreleased changelog entry.
Parameters
NameTypeDescription
§sections
unknownOptional array of changelog sections(default: [])
Returns
ChangelogEntry
A new ChangelogEntry object marked as unreleased
Example

Creating an unreleased entry

const unreleased = createUnreleasedEntry([
  createChangelogSection('features', 'Added', [item]),
])
// => { version: 'Unreleased', date: null, unreleased: true, sections: [...] }
§function

deduplicateItems(changelog: Changelog): Changelog

Removes duplicate items across all sections.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to deduplicate
Returns
Changelog
A new changelog without duplicate items
Example

Deduplicating items across sections

const deduped = deduplicateItems(changelog)
// Duplicate items (same scope:description) are removed
§function

diffChangelogs(source: Changelog, target: Changelog): ChangelogDiff

Computes the diff between two changelogs.
Parameters
NameTypeDescription
§source
ChangelogThe source/original changelog
§target
ChangelogThe target/modified changelog
Returns
ChangelogDiff
Detailed diff of changes
Example

Comparing two changelogs

const diff = diffChangelogs(mainChangelog, branchChangelog)
console.log(`Added: ${diff.added.length}, Removed: ${diff.removed.length}`)
§function

diffEntries(source: ChangelogEntry, target: ChangelogEntry): EntryDiff

Computes the diff between two changelog entries.
Parameters
NameTypeDescription
§source
ChangelogEntryThe source entry
§target
ChangelogEntryThe target entry
Returns
EntryDiff
Detailed entry diff
Example

Computing diff between two entries

const diff = diffEntries(entryV1, entryV2)
// => { version: '1.0.0', changes: [{ path: ['date'], type: 'changed', ... }], sectionsChanged: true }
§function

excludeByScope(changelog: Changelog, scopes: unknown): Changelog

Excludes items by scope.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§scopes
unknownScopes to exclude
Returns
Changelog
A new changelog without items matching the scopes
Example

Excluding items by scope

const publicChanges = excludeByScope(changelog, ['internal', 'test'])
// Items scoped to 'internal' or 'test' are removed
§function

filterBreakingChanges(changelog: Changelog): Changelog

Filters entries that have breaking changes.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
Returns
Changelog
A new changelog with only entries containing breaking changes
Example

Filtering for breaking changes

const breaking = filterBreakingChanges(changelog)
// Only entries containing breaking changes or items marked as breaking
§function

filterByDateRange(changelog: Changelog, startDate?: string, endDate?: string): Changelog

Filters entries by release date.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§startDate?
stringStart date (inclusive, ISO format)
§endDate?
stringEnd date (inclusive, ISO format)
Returns
Changelog
A new changelog with entries in the date range
Example

Filtering entries by date range

const q1 = filterByDateRange(changelog, '2024-01-01', '2024-03-31')
// Entries released in Q1 2024
§function

filterByScope(changelog: Changelog, scopes: unknown): Changelog

Filters items by scope.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§scopes
unknownScopes to include
Returns
Changelog
A new changelog with only items matching the scopes
Example

Filtering items by scope

const apiChanges = filterByScope(changelog, ['api', 'core'])
// Only items scoped to 'api' or 'core'
§function

filterByVersionRange(changelog: Changelog, range: string): Changelog

Filters entries by version range using semver.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§range
stringSemver range string (e.g., '>=1.0.0 <2.0.0')
Returns
Changelog
A new changelog with entries matching the range
Example

Filtering by semver range

const majors = filterByVersionRange(changelog, '>=1.0.0 <2.0.0')
§function

filterEntries(changelog: Changelog, predicate: EntryPredicate): Changelog

Filters entries using a predicate function.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§predicate
EntryPredicateFunction that returns true for entries to keep
Returns
Changelog
A new changelog with filtered entries
Example

Filtering out unreleased entries

const filtered = filterEntries(changelog, (entry) => !entry.unreleased)
§function

filterFromVersion(changelog: Changelog, startVersion: string): Changelog

Filters entries from a start version.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§startVersion
stringThe minimum version (inclusive)
Returns
Changelog
A new changelog with entries >= startVersion
Example

Filtering from a start version

const recent = filterFromVersion(changelog, '2.0.0')
// Only entries for version 2.0.0 and later
§function

filterItems(changelog: Changelog, predicate: ItemPredicate): Changelog

Filters items within sections.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§predicate
ItemPredicateFunction that returns true for items to keep
Returns
Changelog
A new changelog with filtered items
Example

Filtering items with references

const withRefs = filterItems(changelog, (item) => item.references.length > 0)
// Only items with issue/PR references
§function

filterRecentEntries(changelog: Changelog, count: number, includeUnreleased: boolean): Changelog

Gets the N most recent entries.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§count
numberNumber of entries to keep
§includeUnreleased
booleanWhether to include unreleased in count (default: false)(default: false)
Returns
Changelog
A new changelog with only the most recent entries
Example

Getting the most recent entries

const latest = filterRecentEntries(changelog, 5)
// Last 5 released versions (plus unreleased if present)
§function

filterSections(changelog: Changelog, predicate: SectionPredicate): Changelog

Filters sections within each entry.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§predicate
SectionPredicateFunction that returns true for sections to keep
Returns
Changelog
A new changelog with filtered sections
Example

Filtering for user-facing sections

const userFacing = filterSections(changelog, (section) =>
  ['features', 'fixes', 'breaking'].includes(section.type)
)
§function

filterSectionTypes(changelog: Changelog, types: unknown): Changelog

Keeps only specified section types.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§types
unknownSection types to keep
Returns
Changelog
A new changelog with only specified section types
Example

Filtering to specific section types

const userChanges = filterSectionTypes(changelog, ['features', 'fixes'])
// Only features and fixes sections remain
§function

filterToVersion(changelog: Changelog, endVersion: string): Changelog

Filters entries up to an end version.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to apply the version filter to
§endVersion
stringThe maximum version (inclusive)
Returns
Changelog
A new changelog with entries <= endVersion
Example

Filtering to an end version

const legacy = filterToVersion(changelog, '1.9.9')
// Only entries for versions up to 1.9.9
§function

filterVersionRange(changelog: Changelog, startVersion: string, endVersion: string): Changelog

Gets entries within a version range (inclusive).
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to filter
§startVersion
stringThe minimum version (inclusive)
§endVersion
stringThe maximum version (inclusive)
Returns
Changelog
A new changelog with entries in the range
Example

Filtering entries within a version range

const range = filterVersionRange(changelog, '1.5.0', '2.0.0')
// Entries from 1.5.0 through 2.0.0
§function

getEntryByVersion(changelog: Changelog, version: string): ChangelogEntry

Gets an entry by version from a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to search
§version
stringThe version to find
Returns
ChangelogEntry
The entry if found, undefined otherwise
Example

Getting an entry by version

const entry = getEntryByVersion(changelog, '1.0.0')
// => ChangelogEntry for 1.0.0 or undefined
§function

getListMarker(useAsterisks: boolean): string

Creates a list item marker.
Parameters
NameTypeDescription
§useAsterisks
booleanWhether to use * instead of -
Returns
string
The list item marker ('- ' or '* ')
Example

Getting list markers

getListMarker(false) // => '- '
getListMarker(true)  // => '* '
§function

getSectionHeading(type: ChangelogSectionType, customHeadings?: Partial<Record<ChangelogSectionType, string>>): string

Gets the heading for a section type, respecting custom headings.
Parameters
NameTypeDescription
§type
ChangelogSectionTypeThe changelog section type to get the heading for
§customHeadings?
Partial<Record<ChangelogSectionType, string>>Optional map of custom section type to heading overrides
Returns
string
The heading string to use
Example

Getting section headings

getSectionHeading('features')
// => 'Added'

getSectionHeading('features', { features: 'New Features' })
// => 'New Features'
§function

getSectionType(heading: string): ChangelogSectionType

Determines the section type from a heading string. Returns 'other' if the heading is not recognized.
Parameters
NameTypeDescription
§heading
stringThe heading string to parse
Returns
ChangelogSectionType
The corresponding ChangelogSectionType
Example

Mapping heading strings to section types

getSectionType('Added')
// => 'features'

getSectionType('Bug Fixes')
// => 'fixes'

getSectionType('Custom Section')
// => 'other'
§function

getShortHash(hash: string): string

Extracts the short hash from a full commit hash.
Parameters
NameTypeDescription
§hash
stringThe full commit hash
Returns
string
The first 7 characters of the hash
Example

Extracting short hash from full hash

getShortHash('abc1234def5678901234567890')
// => 'abc1234'
§function

hasVersion(changelog: Changelog, version: string): boolean

Checks if a changelog contains a specific version.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to search
§version
stringThe version to look for
Returns
boolean
True if the version exists in the changelog
Example

Checking if a changelog contains a version

hasVersion(changelog, '2.0.0')
// => true if an entry for version 2.0.0 exists
§function

haveSameVersions(a: Changelog, b: Changelog): boolean

Checks if two changelogs have the same entries (by version). Does not compare entry contents, only versions present.
Parameters
NameTypeDescription
ChangelogFirst changelog
ChangelogSecond changelog
Returns
boolean
True if both changelogs have the same versions
Example

Checking if changelogs have the same versions

haveSameVersions(changelog1, changelog2)
// => true if both have entries for the same version strings
§function

isChangelogEqual(a: Changelog, b: Changelog): boolean

Checks if two changelogs are structurally identical.
Parameters
NameTypeDescription
ChangelogFirst changelog
ChangelogSecond changelog
Returns
boolean
True if changelogs are identical
Example

Checking changelog equality

if (isChangelogEqual(mainChangelog, branchChangelog)) {
  console.log('Changelogs are identical')
}
§function

isCommitRefEqual(a: CommitRef, b: CommitRef): boolean

Checks if two commit references are equal.
Parameters
NameTypeDescription
CommitRefFirst commit ref
CommitRefSecond commit ref
Returns
boolean
True if commit refs are equal
Example

Comparing commit references

isCommitRefEqual(commitA, commitB)
// => true if hash, shortHash, and url match
§function

isEntryContentEqual(a: ChangelogEntry, b: ChangelogEntry): boolean

Checks if two changelog entries describe the same release.
The date and the compare URL are stamped when an entry is generated: the date is the day of generation and the compare URL ends at whatever commit was HEAD. Neither is derived from the commits the entry describes, so an entry regenerated later for the same release differs in both while saying exactly the same thing. This comparison reads the version, the unreleased flag, the raw content, and the sections, which is what a release's changelog entry asserts about the commits behind it.
Parameters
NameTypeDescription
ChangelogEntryFirst entry
ChangelogEntrySecond entry
Returns
boolean
True if both entries carry the same version and sections
Example

Validating a committed entry against one regenerated today

isEntryContentEqual(committedEntry, regeneratedEntry)
// => true even though the dates and compare URLs differ
§function

isEntryEqual(a: ChangelogEntry, b: ChangelogEntry): boolean

Checks if two changelog entries are equal.
Parameters
NameTypeDescription
ChangelogEntryFirst entry
ChangelogEntrySecond entry
Returns
boolean
True if entries are equal
Example

Comparing changelog entries

isEntryEqual(entryA, entryB)
// => true if version, date, sections, and all nested data match
§function

isHeaderEqual(a: ChangelogHeader, b: ChangelogHeader): boolean

Checks if two changelog headers are equal.
Parameters
NameTypeDescription
ChangelogHeaderFirst header
ChangelogHeaderSecond header
Returns
boolean
True if headers are equal
Example

Comparing changelog headers

isHeaderEqual(changelog1.header, changelog2.header)
// => true if titles, descriptions, and links match
§function

isIssueRefEqual(a: IssueRef, b: IssueRef): boolean

Checks if two issue references are equal.
Parameters
NameTypeDescription
IssueRefFirst issue ref
IssueRefSecond issue ref
Returns
boolean
True if issue refs are equal
Example

Comparing issue references

isIssueRefEqual({ number: 42, type: 'issue' }, { number: 42, type: 'issue' })
// => true
§function

isItemEqual(a: ChangelogItem, b: ChangelogItem): boolean

Checks if two changelog items are equal.
Parameters
NameTypeDescription
ChangelogItemFirst item
ChangelogItemSecond item
Returns
boolean
True if items are equal
Example

Comparing changelog items

isItemEqual(itemA, itemB)
// => true if description, scope, breaking, commits, and references match
§function

isLinkEqual(a: ChangelogLink, b: ChangelogLink): boolean

Checks if two changelog links are equal.
Parameters
NameTypeDescription
ChangelogLinkFirst link
ChangelogLinkSecond link
Returns
boolean
True if links are equal
Example

Comparing changelog links

isLinkEqual({ label: '1.0.0', url: '...' }, { label: '1.0.0', url: '...' })
// => true
§function

isMetadataEqual(a: ChangelogMetadata, b: ChangelogMetadata): boolean

Checks if two changelog metadata objects are equal.
Parameters
NameTypeDescription
ChangelogMetadataFirst metadata
ChangelogMetadataSecond metadata
Returns
boolean
True if metadata are equal
Example

Comparing changelog metadata

isMetadataEqual(changelog1.metadata, changelog2.metadata)
// => true if format, isConventional, repositoryUrl, and warnings match
§function

isSectionEqual(a: ChangelogSection, b: ChangelogSection): boolean

Checks if two changelog sections are equal.
Parameters
NameTypeDescription
ChangelogSectionFirst section
ChangelogSectionSecond section
Returns
boolean
True if sections are equal
Example

Comparing changelog sections

isSectionEqual(featuresA, featuresB)
// => true if type, heading, and all items match
§function

mergeChangelogs(source: Changelog, target: Changelog, options?: MergeOptions): MergeResult

Merges two changelogs together.
Parameters
NameTypeDescription
§source
ChangelogThe source changelog
§target
ChangelogThe target changelog
§options?
MergeOptionsOptional merge options
Returns
MergeResult
The merge result with merged changelog and stats
Example

Merging two changelogs

const result = mergeChangelogs(mainChangelog, branchChangelog)
console.log(`Merged ${result.stats.merged} entries`)
§function

normalizeSectionHeadings(changelog: Changelog): Changelog

Normalizes section headings to standard format.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to normalize
Returns
Changelog
A new changelog with normalized section headings
Example

Normalizing section headings

const normalized = normalizeSectionHeadings(changelog)
// 'New Features' becomes 'Added', 'Bug Fixes' becomes 'Fixed', etc.
§function

parseChangelog(content: string, source?: string): Changelog

Parses a changelog markdown string into a Changelog object.
Parameters
NameTypeDescription
§content
stringThe markdown content to parse
§source?
stringOptional source file path
Returns
Changelog
Parsed Changelog object
Example

Parsing a changelog markdown string

const markdown = `# Changelog

## [1.0.0] - 2024-01-15

### Added
- Initial release`

const changelog = parseChangelog(markdown, 'CHANGELOG.md')
// => { header: { title: '# Changelog', ... }, entries: [{ version: '1.0.0', ... }] }
§function

parseCommitRefs(text: string, baseUrl?: string): CommitRef[]

Parses commit references from a line. Examples: (abc1234), [abc1234], commit abc1234
Parameters
NameTypeDescription
§text
stringThe text to parse for commit references
§baseUrl?
stringOptional base URL for constructing commit links
Returns
CommitRef[]
An array of parsed CommitRef objects
Example

Parsing commit references from text

parseCommitRefs('Fixed bug (abc1234)', 'https://github.com/org/repo')
// => [{ hash: 'abc1234', shortHash: 'abc1234', url: 'https://github.com/org/repo/commit/abc1234' }]
§function

parseIssueRefs(text: string, baseUrl?: string): IssueRef[]

Parses issue/PR references from a line. Examples: #123, GH-123, closes #123
Parameters
NameTypeDescription
§text
stringThe text to parse for issue references
§baseUrl?
stringOptional base URL for constructing issue links
Returns
IssueRef[]
An array of parsed IssueRef objects
Example

Parsing issue references from text

parseIssueRefs('Closes #42 and PR #123', 'https://github.com/org/repo')
// => [{ number: 42, type: 'issue', url: '...' }, { number: 123, type: 'pull-request', url: '...' }]
§function

parseScopeFromItem(text: string): ScopeFromItem

Parses the scope from a changelog item. Example: "scope: description" -> { scope: "scope", description: "description" }
Parameters
NameTypeDescription
§text
stringThe text to parse for scope
Returns
ScopeFromItem
An object with optional scope and the description
Example

Parsing scope from changelog items

parseScopeFromItem('**api:** Add new endpoint')
// => { scope: 'api', description: 'Add new endpoint' }

parseScopeFromItem('Simple change without scope')
// => { scope: undefined, description: 'Simple change without scope' }
§function

parseVersionFromHeading(heading: string): ParsedVersionHeading

Parses a version string from a heading. Examples: "1.2.3", "v1.2.3", "[1.2.3]", "1.2.3 - 2024-01-01"
Parameters
NameTypeDescription
§heading
stringThe heading string to parse
Returns
ParsedVersionHeading
An object containing the parsed version, date, and optional compareUrl
Example

Parsing version headings

parseVersionFromHeading('[1.2.3] - 2024-01-15')
// => { version: '1.2.3', date: '2024-01-15', compareUrl: undefined }

parseVersionFromHeading('v2.0.0')
// => { version: '2.0.0', date: null, compareUrl: undefined }
§function

releaseUnreleased(changelog: Changelog, version: string, date?: string, compareUrl?: string): Changelog

Creates a new release entry from the current unreleased entry.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog containing the unreleased entry
§version
stringThe version number for the release
§date?
stringThe release date (defaults to today)
§compareUrl?
stringOptional comparison URL
Returns
Changelog
A new changelog with the unreleased entry converted to a release
Example

Releasing unreleased changes as a new version

const released = releaseUnreleased(changelog, '2.0.0', '2024-03-01')
// Unreleased entry becomes version 2.0.0 with the specified date
§function

removeEmptyEntries(changelog: Changelog, keepUnreleased: boolean): Changelog

Removes empty entries (entries with no sections or only empty sections).
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to remove empty entries from
§keepUnreleased
booleanWhether to keep an empty unreleased entry (default: true)(default: true)
Returns
Changelog
A new changelog with empty entries removed
Example

Removing empty entries

const cleaned = removeEmptyEntries(changelog)
// Entries with no content are removed (unreleased kept by default)

const strict = removeEmptyEntries(changelog, false)
// Even empty unreleased entry is removed
§function

removeEmptySections(changelog: Changelog): Changelog

Removes empty sections from all entries.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to remove empty sections from
Returns
Changelog
A new changelog with empty sections removed
Example

Removing empty sections from all entries

const cleaned = removeEmptySections(changelog)
// Sections with no items are removed from all entries
§function

removeEntries(changelog: Changelog, versions: unknown, options?: RemoveEntryOptions): Changelog

Removes multiple entries from a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to remove from
§versions
unknownThe versions to remove
§options?
RemoveEntryOptionsOptional removal options
Returns
Changelog
A new changelog without the specified entries
Example

Removing multiple entries

const cleaned = removeEntries(changelog, ['0.1.0', '0.2.0'])
// Pre-release versions removed from changelog
§function

removeEntry(changelog: Changelog, version: string, options?: RemoveEntryOptions): Changelog

Removes an entry from a changelog by version.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to remove from
§version
stringThe version to remove
§options?
RemoveEntryOptionsOptional removal options
Returns
Changelog
A new changelog without the specified entry
Example

Removing an entry by version

const newChangelog = removeEntry(changelog, '1.0.0')
§function

removeItem(changelog: Changelog, version: string, sectionType: string, itemDescription: string, options?: RemoveSectionOptions): Changelog

Removes an item from an entry by description.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog containing the entry to modify
§version
stringThe version of the entry to modify
§sectionType
stringThe section type containing the item
§itemDescription
stringThe description of the item to remove
§options?
RemoveSectionOptionsOptional removal options
Returns
Changelog
A new changelog without the specified item
Example

Removing a specific item from a section

const updated = removeItem(changelog, '1.0.0', 'features', 'Add dark mode')
// The 'Add dark mode' item is removed from features in 1.0.0
§function

removeSection(changelog: Changelog, version: string, sectionType: string, options?: RemoveSectionOptions): Changelog

Removes a section from an entry.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog containing the entry to modify
§version
stringThe version of the entry to modify
§sectionType
stringThe section type to remove
§options?
RemoveSectionOptionsOptional removal options
Returns
Changelog
A new changelog without the specified section
Example

Removing a deprecated section

const updated = removeSection(changelog, '1.0.0', 'deprecated')
// Version 1.0.0 no longer has a deprecated section
§function

removeUnreleased(changelog: Changelog, options?: RemoveEntryOptions): Changelog

Removes the unreleased entry if it exists.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to remove the unreleased entry from
§options?
RemoveEntryOptionsOptional removal options
Returns
Changelog
A new changelog without the unreleased entry
Example

Removing the unreleased entry

const released = removeUnreleased(changelog)
// Changelog without the unreleased entry

// Silently ignore if not found
const safe = removeUnreleased(changelog, { throwIfNotFound: false })
§function

resolveOptions(options?: SerializeOptions): Required<SerializeOptions>

Merges user options with defaults.
Parameters
NameTypeDescription
§options?
SerializeOptionsUser-provided options
Returns
Required<SerializeOptions>
Complete options with defaults applied
Example

Resolving serialize options with defaults

const opts = resolveOptions({ includeCommits: true })
// => { includeCommits: true, includeScope: true, lineEnding: '\n', ... }
§function

reverseEntries(changelog: Changelog): Changelog

Reverses the order of entries.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to reverse
Returns
Changelog
A new changelog with reversed entries
Example

Reversing entry order

const reversed = reverseEntries(changelog)
// Oldest entries now appear first
§function

serializeChangelog(changelog: Changelog, options?: SerializeOptions): string

Serializes a Changelog object to markdown string.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to serialize
§options?
SerializeOptionsOptional serialization options
Returns
string
The markdown string representation
Examples

Basic serialization

const markdown = serializeChangelog(changelog)

Serializing with custom options

const markdown = serializeChangelog(changelog, {
  includeCommits: false,
  useAsterisks: true,
})
§function

serializeChangelogToJson(changelog: Changelog, options?: JsonSerializeOptions): string

Serializes a Changelog object to JSON string.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog object to convert to JSON
§options?
JsonSerializeOptionsOptional JSON serialization options
Returns
string
The JSON string representation
Examples

Basic JSON serialization

const json = serializeChangelogToJson(changelog)

Pretty-printing with custom indentation

const json = serializeChangelogToJson(changelog, {
  pretty: true,
  indent: 4,
})
§function

sortEntries(changelog: Changelog): Changelog

Sorts entries by version (descending - newest first).
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to sort
Returns
Changelog
A new changelog with sorted entries
Example

Sorting changelog entries by version

const sorted = sortEntries(changelog)
// Entries ordered: Unreleased, 2.0.0, 1.1.0, 1.0.0, ...
§function

sortEntriesByDate(changelog: Changelog): Changelog

Sorts entries by date (newest first).
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to sort
Returns
Changelog
A new changelog with sorted entries
Example

Sorting entries by date

const sorted = sortEntriesByDate(changelog)
// Entries ordered by release date, most recent first
§function

sortSections(changelog: Changelog, order?: unknown): Changelog

Sorts sections within each entry by a specified order.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to sort
§order?
unknownOptional custom section order (defaults to standard order)
Returns
Changelog
A new changelog with sorted sections
Example

Sorting sections within entries

const sorted = sortSections(changelog)
// Sections in each entry follow: breaking, features, fixes, ...

const custom = sortSections(changelog, ['fixes', 'features', 'breaking'])
// Custom ordering: fixes first, then features, then breaking
§function

stripMetadata(changelog: Changelog): Changelog

Strips metadata from a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to strip
Returns
Changelog
A new changelog with minimal metadata
Example

Stripping metadata from a changelog

const stripped = stripMetadata(changelog)
// Source and warnings removed, only format and isConventional retained
§function

summarizeDiff(diff: ChangelogDiff): string

Creates a human-readable summary of a changelog diff.
Parameters
NameTypeDescription
§diff
ChangelogDiffThe diff to summarize
Returns
string
A string summary of the changes
Example

Creating human-readable diff summary

const diff = diffChangelogs(oldChangelog, newChangelog)
summarizeDiff(diff)
// => 'Added 2 version(s): 1.2.0, 1.1.0; Modified 1 version(s): 1.0.0'
§function

toJsonObject(changelog: Changelog, options?: JsonSerializeOptions): Record<string, unknown>

Converts a Changelog to a plain JSON-serializable object. Useful when you need the object itself rather than a string.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to convert
§options?
JsonSerializeOptionsOptional JSON serialization options
Returns
Record<string, unknown>
A plain object suitable for JSON serialization
Example

Converting changelog to plain object

const obj = toJsonObject(changelog, { includeSource: true })
// => { source: 'CHANGELOG.md', header: { title: '...', ... }, entries: [...] }

// Send as API response
res.json(obj)
§function

tokenize(input: string): Token[]

Tokenizes a changelog markdown string into tokens.
Parameters
NameTypeDescription
§input
stringThe markdown content to tokenize
Returns
Token[]
Array of tokens
Example

Tokenizing changelog markdown

const tokens = tokenize('# Changelog\n\n## [1.0.0]\n- Added feature')
// => [{ type: 'heading-1', value: 'Changelog', ... }, { type: 'heading-2', ... }, ...]
§function

transformEntries(changelog: Changelog, transformer: EntryTransformer): Changelog

Transforms all entries in a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to transform
§transformer
EntryTransformerFunction to transform each entry
Returns
Changelog
A new changelog with transformed entries
Example

Transforming all entries

const transformed = transformEntries(changelog, (entry) => ({
  ...entry,
  date: entry.date?.toUpperCase()
}))
§function

transformItems(changelog: Changelog, transformer: ItemTransformer): Changelog

Transforms all items in all sections.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to transform
§transformer
ItemTransformerFunction to transform each item
Returns
Changelog
A new changelog with transformed items
Example

Prefixing item descriptions with scope

const prefixed = transformItems(changelog, (item) => ({
  ...item,
  description: `[${item.scope || 'misc'}] ${item.description}`,
}))
§function

transformSections(changelog: Changelog, transformer: SectionTransformer): Changelog

Transforms all sections in all entries.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to transform
§transformer
SectionTransformerFunction to transform each section
Returns
Changelog
A new changelog with transformed sections
Example

Uppercasing section headings

const renamed = transformSections(changelog, (section) => ({
  ...section,
  heading: section.heading.toUpperCase(),
}))
§function

updateEntry(changelog: Changelog, version: string, updates: Partial<ChangelogEntry> | (entry: ChangelogEntry) => ChangelogEntry): Changelog

Updates a specific entry by version.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to update
§version
stringVersion of entry to update
§updates
Partial<ChangelogEntry> | (entry: ChangelogEntry) => ChangelogEntryPartial entry updates or transformer function
Returns
Changelog
A new changelog with updated entry
Example

Updating a specific entry

const updated = updateEntry(changelog, '1.0.0', { date: '2024-01-15' })

// Or with transformer function
const modified = updateEntry(changelog, '1.0.0', (entry) => ({
  ...entry,
  compareUrl: `https://github.com/org/repo/compare/v0.9.0...v${entry.version}`,
}))
§function

updateHeader(changelog: Changelog, updates: Partial<ChangelogHeader>): Changelog

Updates the header of a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to update
§updates
Partial<ChangelogHeader>Partial header updates
Returns
Changelog
A new changelog with updated header
Example

Updating the changelog header

const updated = updateHeader(changelog, { title: '# Release Notes' })
§function

updateMetadata(changelog: Changelog, updates: Partial<ChangelogMetadata>): Changelog

Updates the metadata of a changelog.
Parameters
NameTypeDescription
§changelog
ChangelogThe changelog to update
§updates
Partial<ChangelogMetadata>Partial metadata updates
Returns
Changelog
A new changelog with updated metadata
Example

Updating changelog metadata

const updated = updateMetadata(changelog, { repositoryUrl: 'https://github.com/org/repo' })
§function

validateChangelog(changelog: unknown): ValidationResult

Validates a changelog object against the schema.
Parameters
NameTypeDescription
§changelog
unknownThe changelog object to validate
Returns
ValidationResult
Validation result with any errors
Example

Validating a changelog object

const result = validateChangelog(myChangelog)
if (!result.valid) {
  console.log('Validation errors:', result.errors)
}

◈ Interfaces

§interface

RemoveSectionOptions

Options for removing a section or item.
Properties
§readonly throwIfNotFound?:booleanThrow error if section/item not found (default: true)
§interface

AddEntryOptions

Options for adding an entry.
Properties
§readonly position?:number | "start" | "end"Position to insert (default: 0, at the beginning)
§readonly replaceExisting?:booleanReplace existing entry with same version
§readonly updateMetadata?:booleanUpdate metadata after adding
§interface

Changelog

Changelog
Complete representation of a CHANGELOG.md file. Designed for lossless round-tripping: parse -> modify -> serialize.
Properties
§readonly entries:unknownVersion entries, ordered newest first
§readonly header:ChangelogHeaderFile header/preamble content
§readonly metadata:ChangelogMetadataAdditional metadata extracted during parsing
§readonly source?:stringOriginal file path (if parsed from file)
§interface

ChangelogDiff

Represents the diff between two changelogs.
Properties
§readonly added:unknownEntries added in target but not in source
§readonly identical:booleanWhether changelogs are structurally identical
§readonly modified:unknownEntries present in both but with differences
§readonly removed:unknownEntries removed from source but not in target
§readonly stats:DiffStatsSummary statistics
§interface

ChangelogEntry

Changelog Entry
Represents a single version entry in a changelog.
Properties
§readonly compareUrl?:stringCompare URL (e.g., GitHub compare link)
§readonly date:stringRelease date (ISO format or null for unreleased)
§readonly rawContent?:stringRaw text for entries that couldn't be parsed structurally
§readonly sections:unknownGrouped changes by category
§readonly unreleased:booleanWhether this is an unreleased/upcoming section
§readonly version:stringVersion string (e.g., "1.2.3")
§interface

ChangelogHeader

Changelog Header
The header section of a changelog file.
Properties
§readonly description:unknownDescription paragraphs between title and first entry
§readonly title:stringTitle (e.g., "# Changelog")
§interface

ChangelogItem

Changelog Item
Represents an individual change within a changelog section.
Properties
§readonly breaking:booleanWhether this is a breaking change
§readonly commits:unknownCommit references
§readonly description:stringDescription of the change
§readonly indirect?:booleanWhether this is an indirect change (dependency or infrastructure)
§readonly references:unknownIssue/PR references
§readonly scope?:stringScope (e.g., "api", "cli")
§readonly source?:CommitSourceClassification source (for auditing/debugging)
§interface

ChangelogMetadata

Changelog Metadata
Additional information extracted during parsing.
Properties
§readonly format:ChangelogFormatDetected changelog format/style
§readonly isConventional:booleanWhether the file follows conventional changelog spec
§readonly packageName?:stringPackage name if detected
§readonly repositoryUrl?:stringRepository URL if detected
§readonly warnings:unknownParser warnings/notes
§interface

ChangelogSection

Changelog Section
Represents a category of changes (Features, Bug Fixes, etc.)
Properties
§readonly heading:stringSection heading as it appears in file
§readonly items:unknownIndividual change items
§readonly type:ChangelogSectionTypeSection type (features, fixes, etc.)
§interface

CommitRef

Commit Reference
Represents a reference to a git commit in a changelog item.
Properties
§readonly hash:stringFull commit hash
§readonly shortHash:stringShort commit hash (typically 7 characters)
§readonly url?:stringURL to the commit (e.g., GitHub commit link)
§interface

CompatibilityResult

Schema compatibility check result.
Properties
§readonly compatible:booleanWhether schemas are compatible
§readonly differences:unknownList of schema differences found
§interface

DiffStats

Statistics about the diff.
Properties
§readonly addedCount:numberNumber of added entries
§readonly modifiedCount:numberNumber of modified entries
§readonly removedCount:numberNumber of removed entries
§readonly totalChanges:numberTotal number of property changes across all modified entries
§interface

EntryDiff

Represents differences in a single entry.
Properties
§readonly addedSections:unknownSections added in target
§readonly changes:unknownList of property differences
§readonly modifiedSections:unknownSections that were modified
§readonly removedSections:unknownSections removed from source
§readonly source:ChangelogEntryOriginal entry (from source)
§readonly target:ChangelogEntryModified entry (from target)
§readonly version:stringVersion of the entry
§interface

IssueRef

Issue/PR Reference
Represents a reference to an issue or pull request.
Properties
§readonly number:numberIssue or PR number
§readonly type:"issue" | "pull-request"Type of reference
§readonly url?:stringURL to the issue/PR
§interface

ItemDiff

Represents differences in a single item.
Properties
§readonly changes:unknownList of property changes
§readonly source:ChangelogItemSource item
§readonly sourceDescription:stringDescription from source
§readonly target:ChangelogItemTarget item
§interface

JsonSerializeOptions

JSON serialization options.
Properties
§readonly includeEmptyArrays?:booleanInclude empty arrays
§readonly includeMetadata?:booleanInclude metadata in output
§readonly includeSource?:booleanInclude source path in output
§readonly indent?:numberIndentation size (for pretty printing)
§readonly pretty?:booleanPretty print with indentation
§interface

MergeOptions

Options for merging changelogs.
Properties
§readonly entryStrategy?:MergeStrategyStrategy for conflicting entries (default: 'union')
§readonly itemStrategy?:MergeStrategyStrategy for conflicting items (default: 'union')
§readonly removeDuplicates?:booleanRemove duplicates
§readonly sectionStrategy?:MergeStrategyStrategy for conflicting sections (default: 'union')
§readonly sortByVersion?:booleanSort entries by version after merge
§readonly useSourceHeader?:booleanUse source header (default: true)
§interface

MergeResult

Result of a merge operation.
Properties
§readonly changelog:ChangelogThe merged changelog
§readonly stats:MergeStatsStatistics about the merge
§interface

MergeStats

Statistics about a merge operation.
Properties
§readonly conflictsResolved:numberNumber of conflicts resolved
§readonly merged:numberEntries merged from both
§readonly sourceOnly:numberEntries only in source
§readonly targetOnly:numberEntries only in target
§readonly totalEntries:numberNumber of entries in result
§interface

PropertyDiff

Represents a single property difference.
Properties
§readonly newValue?:unknownNew value (for 'added' and 'changed')
§readonly oldValue?:unknownPrevious value (for 'removed' and 'changed')
§readonly path:unknownPath to the property (e.g., ['date'], ['sections', '0', 'heading'])
§readonly type:"added" | "changed" | "removed"Type of change
§interface

RemoveEntryOptions

Options for removing an entry.
Properties
§readonly throwIfNotFound?:booleanThrow error if entry not found (default: true)
§interface

SchemaDifference

A single schema difference.
Properties
§readonly path:stringJSON path where difference was found
§readonly sourceType?:stringType in source schema
§readonly targetType?:stringType in target schema
§readonly type:"type-mismatch" | "missing-property" | "extra-property"Type of difference
§interface

SectionDiff

Represents differences in a single section.
Properties
§readonly addedItems:unknownItems added in target
§readonly modifiedItems:unknownItems that were modified
§readonly removedItems:unknownItems removed from source
§readonly source:ChangelogSectionOriginal section (from source)
§readonly target:ChangelogSectionModified section (from target)
§readonly type:stringSection type
§interface

SerializeOptions

Serialization options for controlling output format.
Properties
§readonly entrySpacing?:numberNumber of blank lines between entries
§readonly includeCommits?:booleanInclude commit references
§readonly includeCompareUrls?:booleanInclude compare URLs for entries
§readonly includeDescription?:booleanInclude preamble description in header
§readonly includeRawContent?:booleanInclude raw content fallback
§readonly includeReferences?:booleanInclude issue/PR references
§readonly includeScope?:booleanInclude scope in items
§readonly lineEnding?:" " | " "Line ending style
§readonly sectionHeadings?:Partial<Record<ChangelogSectionType, string>>Custom section headings (overrides defaults)
§readonly sectionOrder?:unknownSection ordering (defaults to standard order)
§readonly sectionSpacing?:numberNumber of blank lines between sections
§readonly useAsterisks?:booleanUse asterisks (*) instead of dashes (-) for list items
§interface

Token

Represents a single parsed token from the changelog markdown.
Properties
§readonly column:numberColumn position where the token starts (1-indexed)
§readonly line:numberLine number where the token appears (1-indexed)
§readonly type:TokenTypeThe type classification of the token
§readonly value:stringThe raw text content of the token

◆ Types

§type

ChangelogFormat

Changelog Format
Detected format/style of the changelog file.
type ChangelogFormat = "keep-a-changelog" | "conventional" | "custom" | "unknown"
§type

ChangelogSectionType

Changelog Section Types
Categories for grouping changes in a changelog entry.
type ChangelogSectionType = "breaking" | "features" | "fixes" | "performance" | "documentation" | "deprecations" | "refactoring" | "tests" | "build" | "ci" | "chores" | "other"
§type

EntryPredicate

Predicate function for filtering entries.
type EntryPredicate = (entry: ChangelogEntry, index: number) => boolean
§type

EntryTransformer

Transformation function for entries.
type EntryTransformer = (entry: ChangelogEntry, index: number) => ChangelogEntry
§type

ItemPredicate

Predicate function for filtering items.
type ItemPredicate = (item: ChangelogItem, section: ChangelogSection, entry: ChangelogEntry) => boolean
§type

ItemTransformer

Transformation function for items.
type ItemTransformer = (item: ChangelogItem, section: ChangelogSection, entry: ChangelogEntry) => ChangelogItem
§type

MergeStrategy

Strategy for resolving merge conflicts.
type MergeStrategy = "source" | "target" | "union" | "latest"
§type

SectionPredicate

Predicate function for filtering sections.
type SectionPredicate = (section: ChangelogSection, entry: ChangelogEntry) => boolean
§type

SectionTransformer

Transformation function for sections.
type SectionTransformer = (section: ChangelogSection, entry: ChangelogEntry) => ChangelogSection
§type

TokenType

Token Types
type TokenType = "heading-1" | "heading-2" | "heading-3" | "heading-4" | "list-item" | "link-text" | "link-url" | "text" | "newline" | "blank-line" | "bold" | "code" | "eof"

● Variables

§type

changelogSchema

JSON Schema for a complete Changelog document. Used for validation and format compatibility checking.
§type

DEFAULT_MERGE_OPTIONS

Default merge options.
§type

DEFAULT_SERIALIZE_OPTIONS

Default serialization options.
§type

SECTION_HEADINGS

Standard section headings for serialization. Maps section types to their preferred heading text.
§type

SECTION_TYPE_MAP

Maps section headings to their canonical types. Used during parsing to normalize different heading styles.