gitlint-parser-base is a foundational utility package providing the core parsing logic for the `gitlint` ecosystem. As of version 2.0.0, it exports a `Parser` class and a `createContext` function, enabling structured extraction of header, body, and footer components from raw Git commit messages. This package primarily serves as an internal dependency for the main `gitlint` project and other related tools that require a standardized way to interpret commit message structure. Its release cadence is closely tied to the `gitlint` project's evolution, with updates driven by changes in Git message parsing requirements or internal architectural enhancements. It is designed to be a building block for linting and analysis, rather than a standalone, general-purpose text parser, specializing in the nuances of Git commit conventions.
npm install gitlint-parser-baseVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the `Parser` class, instantiate it with a commit message, and then parse the message to access its structural components like header, body, and footer.
Use CommonJS `require` syntax: `const { Parser } = require('gitlint-parser-base');` or use dynamic `import()` if truly in an ESM context: `const { Parser } = await import('gitlint-parser-base');`.Review your code for reliance on undocumented internals. Upgrade carefully and test thoroughly, ensuring only the documented `Parser` class and `createContext` function are utilized.
Always provide a valid string representing a Git commit message to the `Parser` constructor. Implement input validation before instantiation to handle edge cases gracefully.
If full linting capabilities are required, use the main `gitlint` package. This package is suitable for scenarios where only structural decomposition of commit messages is needed.
Change the import statement to CommonJS `require`: `const { Parser } = require('gitlint-parser-base');`.Ensure you are destructuring the `Parser` class correctly from the CommonJS `module.exports`: `const { Parser } = require('gitlint-parser-base');`Always provide a non-empty string as the `commitMessage` argument to `new Parser(commitMessage)`. Validate the input before creating a parser instance.
No dependency data recorded yet.