Registry / devops / issue-parser

issue-parser

JSON →
library7.0.1jsnpmunverified

issue-parser is a JavaScript library designed to parse actions, references, and mentions related to issues across various popular Git platforms including GitHub, GitLab, and Bitbucket. It identifies standard closing keywords (e.g., "Fix #1"), duplicate keywords, issue references (e.g., `#123`, `user/repo#456`), and user mentions (e.g., `@username`). The library also provides capabilities for defining custom action types and extending existing parsing formats, making it highly adaptable to specific project needs. The current stable version is 7.0.1. Releases follow semantic versioning, with major versions introducing breaking changes, typically driven by Node.js LTS updates or platform-specific keyword changes, and minor/patch versions for features and fixes. Its key differentiator lies in its comprehensive, configurable support for multiple Git platforms and its ability to parse a wide array of issue-related syntaxes, making it a robust tool for tasks like commit message analysis, changelog generation, or release automation. It is an integral part of the semantic-release ecosystem.

npm install issue-parser
INSTALL
IMPORT
SIG · ISSUE-PARSER
I
issue-parser
devopsjavascriptv7.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

issueParser
import issueParser from 'issue-parser';
import { issueParser } from 'issue-parser';
The library exports a default function for creating parser instances. As a CommonJS module, it can be imported as a default in ESM contexts. CommonJS users should use `const issueParser = require('issue-parser');`.
ParserOptions
import type { ParserOptions } from 'issue-parser';
Type definition for configuring the issue parser, including custom actions and prefixes. Requires TypeScript for type-checking.
ParsedIssues
import type { ParsedIssues } from 'issue-parser';
Type definition for the object returned by the parser, detailing parsed references, actions, and mentions. Requires TypeScript for type-checking.

This quickstart demonstrates how to initialize the issue parser for GitHub's format and parse a sample text containing issue references, closing keywords, and user mentions, logging the structured output.

const issueParser = require('issue-parser'); // Create a parser instance configured for GitHub's issue syntax const parseGithub = issueParser('github'); // Example commit message or description to parse const textToParse = 'This is an issue description. It references user/repo#123 and should Fixes #456. Duplicate of #789 /cc @devuser'; // Parse the text const result = parseGithub(textToParse); console.log('Parsed Issues (GitHub format):'); console.log(JSON.stringify(result, null, 2)); /* Expected output structure (details may vary slightly based on actual parsing logic): { "refs": [ { "raw": "user/repo#123", "slug": "user/repo", "prefix": "#", "issue": "123" } ], "actions": { "close": [ { "raw": "Fixes #456", "action": "Fixes", "prefix": "#", "issue": "456" } ], "duplicate": [ { "raw": "Duplicate of #789", "action": "Duplicate of", "prefix": "#", "issue": "789" } ] }, "mentions": [ { "raw": "@devuser", "prefix": "@", "user": "devuser" } ] } */
Debug
Known issues
breakingVersion 7.0.0 dropped support for Node.js versions below v18. Ensure your Node.js environment meets the minimum requirement of `^18.17 || >=20.6.1`. Previous major versions also introduced breaking changes to Node.js requirements.
fix
Upgrade Node.js to version 18.17.x, 20.6.1+, or a newer compatible LTS release.
affects: >=7.0.0
breakingVersion 3.0.0 introduced significant breaking changes to the API's options and result format. Old options (e.g., `referenceActions`, `blocksActions`) were replaced by a unified `actions` object, and the structure of the returned parsed object also changed.
fix
Review the v3.0.0 changelog and update your parser configuration and the way you access parsed results according to the new `actions` object and result format.
affects: >=3.0.0
breakingVersion 5.0.0 removed support for parsing Waffle.io keywords. This change was made as the Waffle.io service closed down.
fix
Remove any reliance on Waffle.io keyword parsing functionality. The library no longer supports these specific keywords.
affects: >=5.0.0
gotchaAs of v3.0.1, the parser strictly enforces supported delimiter characters between action keywords (e.g., 'Fix', 'Close') and issue references. Parsing might fail if unsupported characters are used as delimiters.
fix
Ensure that only supported delimiter characters (e.g., space, period, comma) are used between action keywords and issue references in the parsed text.
affects: >=3.0.1
Errors
Common errors & fixes
ERROR: issue-parser@7.0.1 requires Node.js version "^18.17 || >=20.6.1". You are running version 16.20.2.
The installed Node.js version does not meet the package's minimum engine requirements.
fix
Upgrade Node.js to a version compatible with `^18.17 || >=20.6.1` using `nvm` or other version managers.
TypeError: issueParser is not a function
Attempting to destructure the default export (`import { issueParser } from 'issue-parser';` or `const { issueParser } = require('issue-parser');`) instead of importing it as a default.
fix
For ESM, use `import issueParser from 'issue-parser';`. For CommonJS, use `const issueParser = require('issue-parser');`.
TypeError: Cannot read properties of undefined (reading 'close')
Attempting to access a property (e.g., `result.actions.close`) that either does not exist in the parsed output for the given input or using an outdated API structure from `v2.x` after upgrading to `v3.0.0` or later.
fix
First, ensure your input string contains valid issue actions or references for the configured format. If upgrading from `v2.x`, review the `v3.0.0` breaking changes regarding the `options` and `result` format, especially the new `actions` object structure.
Upgrade
Version history
7.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
issue-parser — npm install issue-parser · libregistry