Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

prevOpen Source→lerna-clean-changelogs-clinext

lerna-clean-changelogs-cli4.2.6

CLI application to cleanse the lerna/commitizen-generated changelogs

Downloads per monthChangelogMIT Licenselibera manifesto
  • the top
  • Installation
  • IDEA
  • USAGE
  • EMPTY RESULTS…
  • Changelog

Permalink to InstallationInstallation

Idea

This CLI removes the frivolous changelog file entries generated by commitizenopens in a new tab:

cleaning
cleaning

Usage

This CLI runs lerna-clean-changelogs on matching changelog files:

lcc changelog.md
lcc --extras "packages/**/changelog.md"

Without operands, it searches for changelog files in the current directory and its descendants, excluding node_modules. That default search is case-insensitive. lernacleanchangelog is an alias for lcc.

Default cleanup removes bump-only lines and headings of affected empty sections, normalizes blank lines and asterisk bullets, and corrects SourceHut commit URLs. Add -e or --extras to remove heading diff links, convert body H1 headings to H2 and remove lines containing WIP, case-insensitively. Fenced and indented code blocks retain their literal contents.

Empty results and file writes

A successfully cleaned result with zero length is skipped: the original file stays unchanged and the completion summary counts it as skipped. This includes a file containing only removable entries without a final newline. The CLI also skips results that are identical to the original text.

If removing every entry leaves an existing LF, CRLF or CR newline, that nonempty result is written and counted as updated. Running the CLI again skips the unchanged newline-only file. Empty and whitespace-only input files are unchanged.

For example, a file containing only WIP without a final newline stays unchanged with --extras; the same content followed by a newline is replaced by that newline. Use the library directly when your application needs a different policy for writing zero-length results.

Changed files are written through a temporary file in the same directory and then renamed into place. The completion summary reports updated, skipped and failed files.

Permalink to changelogChangelog

Open Changelog
↑ back to top
prev next

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab