The `changelog-parser` package provides a utility to parse and structure content from CHANGELOG.md files within Node.js environments. It extracts key information such as the changelog's title, a general description, and a list of versions, each containing its version number, title, date, raw body, and a parsed body. The current stable version is 3.0.1. The package maintains an irregular release cadence, driven by bug fixes, dependency updates, and new features. It offers flexible input options, allowing parsing from either a file path or a raw text string. A key differentiator is its ability to automatically remove Markdown formatting from entries by default, configurable via an option. It also supports both callback-based and Promise-based APIs, catering to different asynchronous programming styles. The module is primarily focused on adhering to common Markdown changelog formats, supporting various date formats and header levels (H1 or H2) for version sections.
npm install changelog-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates parsing a changelog from both a temporary file and a direct text string, showcasing the promise-based API and the `removeMarkdown` option. It also includes cleanup for the temporary file.
Upgrade Node.js to version 14 or higher (`nvm install 14 && nvm use 14` or similar).
To preserve markdown, pass `{ removeMarkdown: false }` in the options object: `parseChangelog({ filePath: 'CHANGELOG.md', removeMarkdown: false })`.Ensure your options object includes either `filePath: '/path/to/CHANGELOG.md'` or `text: 'your changelog content string'`.
Provide an options object with either a `filePath` string or a `text` string. Example: `parseChangelog({ filePath: 'path/to/CHANGELOG.md' })` or `parseChangelog({ text: '...' })`.Use the CommonJS `require` syntax: `const parseChangelog = require('changelog-parser')`.Verify that the `filePath` provided is correct and that the Node.js process has read permissions for the file. Use an absolute path or ensure the relative path is correct from `process.cwd()`.
No dependency data recorded yet.