npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

conventional-commits-pattern-filter

v1.1.0

Published

Filter commits by pattern, not just reverted ones

Readme

conventional-commits-pattern-filter

Filter commits by pattern, not just reverted ones.

npm bundle size npm

Why

conventional-commits-filter filters reverted commits. conventional-commits-pattern-filter extends that ability to filter out arbitrary commits based on user defined patterns.

Use case - filtering out another app's commits

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

Use case - filtering out BREAKING CHANGES

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 })

Install

npm i conventional-commits-filter

Usage

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
    }
]

API

conventionalCommitsPatternFilter(options)

Returns a filtered array of commits based on the given field and pattern.

options

Type: object

commits

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 }

field

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!

pattern

Type: string or regex

The pattern to filter commits. Any matching commit will be excluded.

include

Type: boolean

If true, includes matching commits instead of excluding them.

License

NPM Released 2019 by Hrusikesh Panda