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

commitlint-pre-push

v1.0.2

Published

Lint exactly the commits being pushed — an accurate commitlint wrapper for the pre-push git hook

Downloads

1,103

Readme

commitlint-pre-push

Package Node CI License

Lint exactly the commits being pushed — an accurate commitlint wrapper for the pre-push git hook.

Why

The typical pre-push hook recipe guesses which commits are being pushed:

npx --no -- commitlint --from=origin/main --to=HEAD

This guess is wrong in many everyday scenarios:

  • origin/main is stale or doesn't exist locally
  • the branch was forked from another branch, so already-pushed commits get re-linted (and can block the push even though those commits are already published)
  • pushing multiple refs at once
  • force pushes
  • pushing tags or deleting branches

Git already tells the pre-push hook exactly what is being pushed — one line per ref on stdin:

<local ref> <local sha> <remote ref> <remote sha>

commitlint-pre-push parses that input and derives the precise set of commits for each ref update:

  • branch update — commits between the remote sha and the local sha
  • new branch — commits not present on any remote-tracking ref (so commits already pushed to any remote branch are never re-linted)
  • force push — only the replacement commits
  • branch deletion / tag push — nothing to lint, skipped
  • multiple refs — each ref's commits, deduplicated

It then runs your project's own commitlint (your config, your version) on exactly those commits.

Installation

npm install -D commitlint-pre-push

Usage

Add it to your pre-push hook. For example, with husky:

# .husky/pre-push
commitlint-pre-push

Or with a plain .git/hooks/pre-push hook:

#!/bin/sh
npx --no -- commitlint-pre-push

That's it — zero configuration. The remote, refs, and commit ranges all come from the data git passes to the hook.

Outside the hook, if no pre-push input arrives on stdin within a couple of seconds, the tool falls back to a dry run instead of waiting indefinitely. Non-interactive callers can skip the wait by redirecting stdin from /dev/null:

npx --no -- commitlint-pre-push < /dev/null

Dry run

Run it manually in a terminal to preview what a push of the current branch would lint:

npx --no -- commitlint-pre-push

Requirements

License

MIT © Igor Danchenko