Gathering detailed insights and metrics for conventional-commits-pattern-filter
Gathering detailed insights and metrics for conventional-commits-pattern-filter
npm install conventional-commits-pattern-filter
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
1,175
Last Day
1
Last Week
8
Last Month
19
Last Year
139
8 Commits
1 Watching
13 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.0
Package Id
conventional-commits-pattern-filter@1.1.0
Unpacked Size
7.32 kB
Size
3.09 kB
File Count
4
NPM Version
6.4.1
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
60%
8
Compared to previous week
Last month
46.2%
19
Compared to previous month
Last year
-34.1%
139
Compared to previous year
Filter commits by pattern, not just reverted ones.
conventional-commits-filter filters reverted commits. conventional-commits-pattern-filter extends that ability to filter out arbitrary commits based on user defined patterns.
Let's say you have one codebase that is shared by many frontend apps. These apps have different deployments but commit changes to the same, git repo. E.g., consider this history:
<-- app1 wants to release a new version -- >
|
o feat: [app1]: Awesome new feature
|
o fix: [app1]: Fixed that annoying bug
|
o fix: [app2]: Squashed that bug
|
o docs: [app2]: Added awesome documentation
|
o chore: [app1]: Bump version for abc dependency
|
<-- app1 released v1.5.9 -- >
In order to create a new release, app1
wants to include all changes tagged with [app1]
since v1.5.9
release. With conventional-commits-pattern-filter, it can do so:
const allCommits = conventionalCommitsParser(...) // get commits parsed via conventional-commits-parser
const appCommits = filter({commits: allCommits, field: 'subject', pattern: '[app2]' })
// appCommits
o feat: [app1]: Awesome new feature
|
o fix: [app1]: Fixed that annoying bug
|
o chore: [app1]: Bump version for abc dependency
Say you want to extract breaking changes only so that you can share it with stakeholders or do something else with them.
const breakingChanges = filter({ commits, field: 'body', pattern: /^((?!BREAKING CHANGE).)*/igm })
Alternatively, if negative lookahead is not your thing, you can use the include
flag to include matching commits:
const breakingChanges = filter({ commits, field: 'body', pattern: /BREAKING CHANGE/igm, include: true })
npm i conventional-commits-filter
const filter = require('conventional-commits-pattern-filter')
// given a commits array like
const commits = [
{
subject: 'feat: [excludeMe]: some feature',
// other props
},
{
subject: 'feat: thw best thing since sliced bread',
// other props
},
]
const filteredCommits = filter({ commits, field: 'subject', pattern: '[excludeMe]' })
// filteredCommits
[
{
subject: 'feat: thw best thing since sliced bread',
// other props
}
]
Returns a filtered array of commits based on the given field and pattern.
Type: object
Type: array
Array of parsed commits returned by conventional-commits-parser
The commit
object has the following structure:
{ type: 'feat',
scope: 'scope',
subject: 'what an amazing feature',
merge: null,
header: 'feat(scope): what an amazing feature',
body: null,
footer: 'Closes #1',
notes: [],
references:
[ { action: 'Closes',
owner: null,
repository: null,
issue: '1',
raw: '#1',
prefix: '#' } ],
mentions: [],
revert: null }
Type: string
or array
Field(s) to filter on. Can be the name of any valid property/key on the commit
object from commits
array.
filter({ commits, field: ['subject', 'body'], pattern: '[excludeMe]' })
Note: Currently only supports simple properties. Send me a PR if you need any deep filtering!
Type: string
or regex
The pattern to filter commits. Any matching commit will be excluded.
Type: boolean
If true, includes matching commits instead of excluding them.
Released 2019 by Hrusikesh Panda
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
50 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More