Gitlint is a widely used linter for Git commit messages, originally implemented in Python, that enforces conventions such as the Conventional Commits specification, ensuring consistent and readable commit history across projects. The `gitlint-parser-node` package is a JavaScript library designed to parse these commit messages specifically within a Node.js environment, adhering to the core parsing logic and conventions used by gitlint. This enables Node.js applications and tooling to programmatically process, analyze, and extract structured information from git commit messages in a compatible manner, without needing to invoke the Python-based gitlint CLI directly. It supports parsing the various components of a commit message, such as type, scope, subject, body, and footers. The current stable version is 1.1.0. Given its focused utility and version history, it appears to be in a maintenance phase, providing a stable foundation for projects requiring gitlint-compatible commit message parsing in JavaScript.
npm install gitlint-parser-nodeVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the `parse` function to extract structured data from a conventional git commit message.
For ES Modules, use `import { parse } from 'gitlint-parser-node';`. For CommonJS, use `const { parse } = require('gitlint-parser-node');`.Validate or sanitize input commit messages before passing them to the `parse` function, especially if the messages come from untrusted or external sources. Handle potential parsing errors gracefully with `try...catch` blocks.
Correct the import statement to use named destructuring: `import { parse } from 'gitlint-parser-node';` for ESM, or `const { parse } = require('gitlint-parser-node');` for CommonJS.Install the package using npm: `npm install gitlint-parser-node` or `npm install -g gitlint-parser-node` if it's a global utility.
No dependency data recorded yet.