{"id":13360,"library":"issue-parser","title":"Issue Parser","description":"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.","status":"active","version":"7.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/semantic-release/issue-parser","tags":["javascript","bitbucket","close","duplicate","fix","github","gitlab","issues","mentions"],"install":[{"cmd":"npm install issue-parser","lang":"bash","label":"npm"},{"cmd":"yarn add issue-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add issue-parser","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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');`.","wrong":"import { issueParser } from 'issue-parser';","symbol":"issueParser","correct":"import issueParser from 'issue-parser';"},{"note":"Type definition for configuring the issue parser, including custom actions and prefixes. Requires TypeScript for type-checking.","symbol":"ParserOptions","correct":"import type { ParserOptions } from 'issue-parser';"},{"note":"Type definition for the object returned by the parser, detailing parsed references, actions, and mentions. Requires TypeScript for type-checking.","symbol":"ParsedIssues","correct":"import type { ParsedIssues } from 'issue-parser';"}],"quickstart":{"code":"const issueParser = require('issue-parser');\n\n// Create a parser instance configured for GitHub's issue syntax\nconst parseGithub = issueParser('github');\n\n// Example commit message or description to parse\nconst textToParse = 'This is an issue description. It references user/repo#123 and should Fixes #456. Duplicate of #789 /cc @devuser';\n\n// Parse the text\nconst result = parseGithub(textToParse);\n\nconsole.log('Parsed Issues (GitHub format):');\nconsole.log(JSON.stringify(result, null, 2));\n\n/*\nExpected output structure (details may vary slightly based on actual parsing logic):\n{\n  \"refs\": [\n    {\n      \"raw\": \"user/repo#123\",\n      \"slug\": \"user/repo\",\n      \"prefix\": \"#\",\n      \"issue\": \"123\"\n    }\n  ],\n  \"actions\": {\n    \"close\": [\n      {\n        \"raw\": \"Fixes #456\",\n        \"action\": \"Fixes\",\n        \"prefix\": \"#\",\n        \"issue\": \"456\"\n      }\n    ],\n    \"duplicate\": [\n      {\n        \"raw\": \"Duplicate of #789\",\n        \"action\": \"Duplicate of\",\n        \"prefix\": \"#\",\n        \"issue\": \"789\"\n      }\n    ]\n  },\n  \"mentions\": [\n    {\n      \"raw\": \"@devuser\",\n      \"prefix\": \"@\",\n      \"user\": \"devuser\"\n    }\n  ]\n}\n*/","lang":"javascript","description":"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."},"warnings":[{"fix":"Upgrade Node.js to version 18.17.x, 20.6.1+, or a newer compatible LTS release.","message":"Version 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.","severity":"breaking","affected_versions":">=7.0.0"},{"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.","message":"Version 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.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Remove any reliance on Waffle.io keyword parsing functionality. The library no longer supports these specific keywords.","message":"Version 5.0.0 removed support for parsing Waffle.io keywords. This change was made as the Waffle.io service closed down.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Ensure that only supported delimiter characters (e.g., space, period, comma) are used between action keywords and issue references in the parsed text.","message":"As 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.","severity":"gotcha","affected_versions":">=3.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade Node.js to a version compatible with `^18.17 || >=20.6.1` using `nvm` or other version managers.","cause":"The installed Node.js version does not meet the package's minimum engine requirements.","error":"ERROR: issue-parser@7.0.1 requires Node.js version \"^18.17 || >=20.6.1\". You are running version 16.20.2."},{"fix":"For ESM, use `import issueParser from 'issue-parser';`. For CommonJS, use `const issueParser = require('issue-parser');`.","cause":"Attempting to destructure the default export (`import { issueParser } from 'issue-parser';` or `const { issueParser } = require('issue-parser');`) instead of importing it as a default.","error":"TypeError: issueParser is not a function"},{"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.","cause":"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.","error":"TypeError: Cannot read properties of undefined (reading 'close')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}