1.0.2 • Published 5 years ago

gitcommitreader v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

GitCommitReader

Simple Readable stream for git commits

Exampes

All commits

GitCommitReader()
    .pipe(new StringifyStream())
    .pipe(process.stdout)
;

Output

{ "hash": "5c24897", "subject": "This is commit" }

Only fix

GitCommitReader({filter: /fix:.*$/})
    .pipe(new StringifyStream())
    .pipe(process.stdout)
;

Output

{ "hash": "5c24897", "subject": "fix: This is commit" }

Only right commits

GitCommitReader({
    filter: /^(\w*)(?:\((.*)\))?:\s*(\[\w+\-\d+\])?\s*(.*)$/,
    pattern: /^(\w*)(?:\((.*)\))?:\s*(\[\w+\-\d+\])?\s*(.*)$/,
    fields: ['type', null, 'jira', 'message']
})
    .pipe(new StringifyStream())
    .pipe(process.stdout)
;

Output

{ "hash": "5c24897", "subject": "feat: [TEAM-1234] This is commit", "type": "feat", "jira": "[TEAM-1234]", "message": "This is commit" }