Registry / testing / remark-common-changelog

remark-common-changelog

JSON →
library2.3.2jsnpmunverified

A remark plugin to lint or fix a Markdown changelog according to the Common Changelog specification. Current stable version 2.3.2 (npm, 2023). ESM-only, requires Node >=12.20. It enforces changelog structure, heading format, version links, dates, release ordering, and can auto-fill empty releases with commit logs. Unlike generic Markdown linting, it specializes in changelog conventions and integrates with git history.

npm install remark-common-changelog
INSTALL
IMPORT
SIG · REMARK-COMMON-CHAN
R
remark-common-changelog
testingjavascriptv2.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (changelog)
import changelog from 'remark-common-changelog'
const changelog = require('remark-common-changelog')
The package is ESM-only since v2.0.0, so CJS require will fail.
remark use
import { remark } from 'remark'; remark().use(changelog)
remark().use(changelog) without importing remark
Use the unified ecosystem: import remark and call .use() with the plugin.
TypeScript types
import type { ... } from 'remark-common-changelog'
TypeScript types are not explicitly documented; may rely on inferred types.

Lint and fix a CHANGELOG.md file using remark-common-changelog plugin with to-vfile for I/O.

import changelog from 'remark-common-changelog' import { readSync, writeSync } from 'to-vfile' import { remark } from 'remark' remark() .use(changelog) .process(readSync('CHANGELOG.md'), (err, file) => { if (err) throw err writeSync(file) }) console.log('CHANGELOG.md linted and fixed (if fix mode enabled)')
Debug
Known issues
breakingv2.0.0 broke ESM/CJS: switched to ESM-only and dropped Node <12.20.
fix
Update Node to >=12.20 and use import instead of require.
affects: >=2.0.0
gotchaChangelog must start with a top-level "Changelog" heading (title rule).
fix
Ensure the first line is '# Changelog' or let fix mode add/update it.
affects: >=2.0.0
gotchaRelease versions must be semver-valid, no 'v' prefix.
fix
Use version format '1.0.0' not 'v1.0.0' in headings.
affects: >=2.0.0
gotchaRelease headings require a link reference (release-version-link-reference rule).
fix
Use '[1.0.0]: <url>' reference style, not inline links.
affects: >=2.0.0
gotchaAuto-fill empty releases with commit log uses git history; may include unwanted commits.
fix
Manually review and edit the filled content.
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CJS require() on an ESM-only package.
fix
Switch to ES modules: use import syntax or rename file to .mjs.
Error: Cannot find module 'remark'
Missing peer dependency 'remark' not installed.
fix
Run 'npm install remark' or include it in your dependencies.
Error: Cannot find module 'to-vfile'
Missing optional dependency used in examples.
fix
Run 'npm install to-vfile' if you are using it in your code.
TypeError: Cannot read properties of undefined (reading 'some')
Changelog file missing or malformed (e.g., no 'Changelog' heading).
fix
Ensure CHANGELOG.md exists and starts with '# Changelog'.
Upgrade
Version history
2.3.2latest on npm
Audit
Dependencies
remarkrequiredRequired as the unified processor to use the plugin.
to-vfileoptionalUsed to read and write VFile from the filesystem in examples, but not a runtime dependency of the plugin itself.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-common-changelog — npm install remark-common-changelog · libregistry