remark-changelog

raw JSON →
1.2.1 verified Fri May 01 auth: no javascript

Lint or fix a changelog written in Markdown following Keep a Changelog conventions. Version 1.2.1, maintained by vweevers. Integrates with remark and provides both linting and automatic fixing for headings, version links, dates, ordering, and release content. Supports Unreleased sections, semver versions, GitHub compare links, and commit log insertion. Differentiated by its fix mode and strict adherence to Keep a Changelog.

error Cannot find module 'remark-changelog'
cause Missing npm install or incorrect import path.
fix
Run 'npm install remark-changelog' and check require/import path.
error TypeError: remark is not a function
cause Using wrong version of remark (v13+ exports differently).
fix
Ensure remark v12 is installed: 'npm install remark@12'.
breaking Version 1.x uses remark 12; not compatible with remark 13+.
fix Use remarkable or update to remark 12.
gotcha Requires Node >=10; does not support ESM natively.
fix Use CommonJS or transpile; no ESM exports.
gotcha Fix mode may reorder releases and changelog entries, potentially causing git conflicts.
fix Review changes before committing; use version control.
npm install remark-changelog
yarn add remark-changelog
pnpm add remark-changelog

Lint a changelog file using remark-changelog plugin with default options.

const remark = require('remark');
const changelog = require('remark-changelog');
const fs = require('fs');

const content = fs.readFileSync('CHANGELOG.md', 'utf8');

remark()
  .use(changelog, { lint: true })
  .process(content, (err, file) => {
    if (err) throw err;
    console.log(file.messages);
  });