Gathering detailed insights and metrics for issue-parser
Gathering detailed insights and metrics for issue-parser
Gathering detailed insights and metrics for issue-parser
Gathering detailed insights and metrics for issue-parser
@types/issue-parser
TypeScript definitions for issue-parser
@zentered/issue-forms-body-parser
Parser for GitHub Issue Form body, also available as GitHub Action
@scalepublishing/issue-parser
Parse and export contents of a SCALE issue
github-issue-parser
markdown parser for github issues
Parser for Github, GitLab and Bitbucket issues actions, references and mentions
npm install issue-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.7
Supply Chain
100
Quality
81
Maintenance
100
Vulnerability
98.6
License
JavaScript (100%)
Total Downloads
241,370,975
Last Day
379,487
Last Week
2,143,114
Last Month
8,687,802
Last Year
86,626,516
MIT License
21 Stars
127 Commits
4 Forks
4 Watchers
8 Branches
11 Contributors
Updated on May 02, 2025
Minified
Minified + Gzipped
Latest Version
7.0.1
Package Id
issue-parser@7.0.1
Unpacked Size
25.92 kB
Size
6.64 kB
File Count
5
NPM Version
10.5.2
Node Version
20.13.1
Published on
May 31, 2024
Cumulative downloads
Total Downloads
Last Day
45.5%
379,487
Compared to previous day
Last Week
8.3%
2,143,114
Compared to previous week
Last Month
0.1%
8,687,802
Compared to previous month
Last Year
56%
86,626,516
Compared to previous year
Parser for Github, GitLab and Bitbucket issues actions, references and mentions
The parser can identify:
1$ npm install --save issue-parser
1const issueParser = require('issue-parser'); 2const parse = issueParser('github'); 3 4parse('Issue description, ref user/package#1, Fix #2, Duplicate of #3 /cc @user'); 5/* 6{ 7 refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}], 8 actions: { 9 close: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}], 10 duplicate: [{raw: 'Duplicate of #3', action: 'Duplicate of', prefix: '#', issue: '3'}], 11 }, 12 mentions: [{raw: '@user', prefix: '@', user: 'user'}], 13} 14*/
1const issueParser = require('issue-parser'); 2const parse = issueParser('gitlab'); 3 4parse('Issue description, ref group/user/package#1, !2, implement #3, /duplicate #4 /cc @user'); 5/* 6{ 7 refs: [ 8 {raw: 'group/user/package#1', slug: 'group/user/package', prefix: '#', issue: '1'}, 9 {raw: '!2', slug: 'group/user/package', prefix: '!', issue: '2'}, 10 ], 11 actions: { 12 close: [{raw: 'implement #3', action: 'Implement', prefix: '#', issue: '4'}], 13 duplicate: [{raw: 'Duplicate of #4', action: 'Duplicate of', prefix: '#', issue: '4'}], 14 }, 15 mentions: [{raw: '@user', prefix: '@', user: 'user'}], 16} 17*/
1const issueParser = require('issue-parser'); 2const parse = issueParser('bitbucket'); 3 4parse('Issue description, ref user/package#1, fixing #2. /cc @user'); 5/* 6{ 7 refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}], 8 actions: { 9 close: [{raw: 'fixing #2', action: 'Fixing', prefix: '#', issue: '2'}], 10 }, 11 mentions: [{raw: '@user', prefix: '@', user: 'user'}], 12} 13*/
1const issueParser = require('issue-parser'); 2const parse = issueParser({actions: {fix: ['complete'], hold: ['holds up']}, issuePrefixes: ['🐛']}); 3 4parse('Issue description, related to user/package🐛1, Complete 🐛2, holds up 🐛3'); 5/* 6{ 7 refs: [{raw: 'user/package🐛1', slug: 'user/package', prefix: '🐛', issue: '1'}], 8 actions: { 9 fix: [{raw: 'Complete 🐛2', action: 'Complete', prefix: '🐛', issue: '2'}], 10 hold: [{raw: 'holds up 🐛3', action: 'Holds up', prefix: '🐛', issue: '3'}], 11 }, 12} 13*/
1const issueParser = require('issue-parser'); 2const parse = issueParser('github', {actions: {parent: ['parent of'], related: ['related to']}}); 3 4parse('Issue description, ref user/package#1, Fix #2, Parent of #3, related to #4 /cc @user'); 5/* 6{ 7 refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}], 8 actions: { 9 close: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}], 10 parent: [{raw: 'Parent of #3', action: 'Parent of', prefix: '#', issue: '3'}], 11 related: [{raw: 'related to #4', action: 'Related to', prefix: '#', issue: '4'}], 12 }, 13 mentions: [{raw: '@user', prefix: '@', user: 'user'}], 14} 15*/
1#1
1{refs: [{raw: '#1', slug: undefined, prefix: '#', issue: '1'}]}
1owner/repo#1
1{refs: [{raw: 'owner/repo#1', slug: 'owner/repo', prefix: '#', issue: '1'}]}
1Fix #1
1{actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}
1Duplicate of #1
1{actions: {duplicate: [{raw: 'Duplicate of #1', action: 'Duplicate of', slug: undefined, prefix: '#', issue: '1'}]}}
1@user
1{mentions: [{raw: '@user', prefix: '@', user: 'user'}]}
1https://github.com/owner/repo/pull/1 2 3Fix https://github.com/owner/repo/issues/2
1{ 2 refs: [{raw: 'https://github.com/owner/repo/pull/1', slug: 'owner/repo', prefix: undefined, issue: '1'},] 3 actions: { 4 close: [ 5 {raw: 'Fix https://github.com/owner/repo/issues/2', action: 'Fix', slug: 'owner/repo', prefix: undefined, issue: '2'} 6 ] 7 } 8}
1FIX #1
1{actions: {close: [{raw: 'FIX #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}
1Fix: #1
1{actions: {close: [{raw: 'Fix: #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}
1Fix #1 `Fix #2` @user1 `@user2`
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user1', prefix: '@', user: 'user1'}] 4}
1\`Fix #1\` \`@user\`
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user1', prefix: '@', user: 'user1'}] 4}
1Fix #1 2 3```js 4console.log('Fix #2'); 5``` 6 7@user1 8 9```js 10console.log('@user2'); 11```
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user1', prefix: '@', user: 'user1'}] 4}
1\`\`\` 2Fix #1 3\`\`\` 4 5\`\`\` 6@user 7\`\`\`
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user', prefix: '@', user: 'user'}] 4}
1Fix #1 2<code>Fix #2</code> 3<code><code>Fix #3</code></code> 4@user1 5<code>@user2</code>
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user1', prefix: '@', user: 'user1'}] 4}
1`<code>`Fix #1`</code>` 2`<code>`@user`</code>`
1{ 2 actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}, 3 mentions: [{raw: '@user', prefix: '@', user: 'user'}] 4}
1Fix #1 Fix #2a Fix a#3
1{actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}
Create a parser.
Type: Object
String
Parser options. Can be github
, gitlab
or bitbucket
for predefined options, or an object for custom options.
Type: Object
Default:
{close: ['close', 'closes', 'closed', 'closing', 'fix', 'fixes', 'fixed', 'fixing', 'resolve', 'resolves', 'resolved', 'resolving', 'implement', 'implements', 'implemented', 'implementing'], duplicate: ['Duplicate of', '/duplicate']}
Object with type of action as key and array of keywords as value.
Each keyword match will be placed in the corresponding property of the result
action
object. For example the with the configuration {actions: fix: ['fixed', 'fixing']}
each action matching fixed
or fixing
will be under result.actions.fix
.
Type: Array<String>
String
Default: [':']
List of delimiter characters allowed between an action keywords and the issue reference. The characters space (
) and tab (
) are always allowed.
Type: Array<String>
String
Default: ['@']
List of keywords used to identify user mentions.
Type: Array<String>
String
Default: ['#', 'gh-']
List of keywords used to identify issues and pull requests.
Type: Array<String>
String
Default: ['https://github.com', 'https://gitlab.com']
List of base URL used to identify issues and pull requests with full URL.
Type: Array<String>
String
Default: ['issues', 'pull', 'merge_requests']
List of URL segment used to identify issues and pull requests with full URL.
Type: Object
Option overrides. Useful when using predefined options
(such as github
, gitlab
or bitbucket
). The overrides
object can define the same properties as options
.
For example, the following will use all the github
predefined options but with a different hosts
option:
1const issueParser = require('issue-parser'); 2const parse = issueParser('github', {hosts: ['https://custom-url.com']});
Parse an issue description and returns a Result object.
Type: String
Issue text to parse.
Type: Object
List of matching actions by type.
Each type of action is an array of objects with the following properties:
Name | Type | Description |
---|---|---|
raw | String | The raw value parsed, for example Fix #1 . |
action | String | The keyword used to identify the action, capitalized. |
slug | String | The repository owner and name, for issue referred as <owner>/<repo>#<issue number> . |
prefix | String | The prefix used to identify the issue. |
issue | String | The issue number. |
Type: Array<Object>
List of issues and pull requests referenced, but not matched with an action.
Each reference has the following properties:
Name | Type | Description |
---|---|---|
raw | String | The raw value parsed, for example #1 . |
slug | String | The repository owner and name, for issue referred as <owner>/<repo>#<issue number> . |
prefix | String | The prefix used to identify the issue. |
issue | String | The issue number. |
Type: Array<Object>
List of users mentioned.
Each mention has the following properties:
Name | Type | Description |
---|---|---|
raw | String | The raw value parsed, for example @user . |
prefix | String | The prefix used to identify the mention. |
user | String | The user name |
Type: Array<Object>
List of all issues and pull requests referenced or matching an action.
Each reference has the following properties:
Name | Type | Description |
---|---|---|
raw | String | The raw value parsed, for example Fix #1 . |
action | String | The keyword used to identify the action or the duplicate, capitalized. Only if matched by an action. |
slug | String | The repository owner and name, for issue referred as <owner>/<repo>#<issue number> . |
prefix | String | The prefix used to identify the issue. |
issue | String | The issue number. |
No vulnerabilities found.
No security vulnerabilities found.