
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
conventional-commits-filter
Advanced tools
Filter out reverted commits parsed by conventional-commits-parser
The conventional-commits-filter npm package is used to filter out commit messages that do not follow the Conventional Commits specification. This is useful in projects that enforce a specific commit message format for better readability, automation, and tooling.
Filtering valid commits
This feature allows you to filter out commits that do not follow the Conventional Commits specification. In the example, only the commits with headers 'feat: add new feature' and 'fix: fix bug' will be considered valid.
const filter = require('conventional-commits-filter');
const commits = [
{ header: 'feat: add new feature' },
{ header: 'fix: fix bug' },
{ header: 'invalid commit message' }
];
const validCommits = filter(commits);
console.log(validCommits);
Filtering invalid commits
This feature allows you to filter out valid commits and only keep the invalid ones. In the example, only the commit with the header 'invalid commit message' will be considered invalid.
const filter = require('conventional-commits-filter');
const commits = [
{ header: 'feat: add new feature' },
{ header: 'fix: fix bug' },
{ header: 'invalid commit message' }
];
const invalidCommits = filter(commits, { ignore: true });
console.log(invalidCommits);
commitlint checks if your commit messages meet the Conventional Commits format. It is more comprehensive than conventional-commits-filter as it provides linting capabilities and can be integrated into CI/CD pipelines.
conventional-changelog is used to generate changelogs based on commit messages that follow the Conventional Commits specification. While it does not filter commits, it complements conventional-commits-filter by providing a way to generate meaningful changelogs.
validate-commit-msg is a tool to validate commit messages against a set of rules, including the Conventional Commits specification. It is similar to conventional-commits-filter but focuses more on validation rather than filtering.
Filter out reverted commits parsed by conventional-commits-parser
$ npm install --save conventional-commits-filter
var conventionalCommitsFilter = require('conventional-commits-filter');
var commits = [{
type: 'revert',
scope: null,
subject: 'feat(): amazing new module',
header: 'revert: feat(): amazing new module\n',
body: 'This reverts commit 56185b7356766d2b30cfa2406b257080272e0b7a.\n',
footer: null,
notes: [],
references: [],
revert: {
header: 'feat(): amazing new module',
hash: '56185b7356766d2b30cfa2406b257080272e0b7a'
},
hash: '789d898b5f8422d7f65cc25135af2c1a95a125ac\n'
}, {
type: 'feat',
scope: null,
subject: 'amazing new module',
header: 'feat(): amazing new module\n',
body: null,
footer: 'BREAKING CHANGE: Not backward compatible.\n',
notes: [],
references: [],
revert: null,
hash: '56185b7356766d2b30cfa2406b257080272e0b7a\n'
}, {
type: 'feat',
scope: null,
subject: 'new feature',
header: 'feat(): new feature\n',
body: null,
footer: null,
notes: [],
references: [],
revert: null,
hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
}, {
type: 'chore',
scope: null,
subject: 'first commit',
header: 'chore: first commit\n',
body: null,
footer: null,
notes: [],
references: [],
revert: null,
hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
}];
commits = conventionalCommitsFilter(commits);
console.log(commits);
/*=>
[{
type: 'feat',
scope: null,
subject: 'new feature',
header: 'feat(): new feature\n',
body: null,
footer: null,
notes: [],
references: [],
revert: null,
hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
}, {
type: 'chore',
scope: null,
subject: 'first commit',
header: 'chore: first commit\n',
body: null,
footer: null,
notes: [],
references: [],
revert: null,
hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
}]
*/
MIT © Steve Mao
FAQs
Filter out reverted commits parsed by conventional-commits-parser.
The npm package conventional-commits-filter receives a total of 4,147,912 weekly downloads. As such, conventional-commits-filter popularity was classified as popular.
We found that conventional-commits-filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.