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

@beuluis/hook-cli

v1.3.0

Published

A small hook cli that can be used with for example husky

Downloads

51

Readme

Contributors Forks Stargazers Issues

About The Project

A small hook cli that can be used with for example husky.

Disclaimer

I know that most of this stuff is already solved by some awesome tools. So this is really just a CLI playground for me.

Installation

npm i -D @beuluis/hook-cli

Usage

Run commands. For example using the hooks in .husky.

```bash
npx hook-cli [command] [...]
```

Commands

checkCommitMessageIssueKey

Check the pattern of a commit message

| Option | Description | Type | default | | ------------------- | ------------------------------------------------------------------------ | --------- | ------- | | -p, --prefix | Prefix of the issue key. | string | | | `-m`, `--message` | Get message from command line instead of file. | `string` | | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkCommitMessageIssueKey "$1" -p "HelloWorld"
npx hook-cli checkCommitMessageIssueKey .git/COMMIT_EDITMSG -p "KEY"
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY"
npx hook-cli checkCommitMessageIssueKey -m "KEY-12 message" -p "KEY" -w

checkCommitMessagePattern

Check the pattern of a commit message

| Option | Description | Type | default | | ------------------- | ------------------------------------------------------------------------ | --------- | ------- | | -p, --pattern | Regex pattern to check the message against. | string | | | `-m`, `--message` | Get message from command line instead of file. | `string` | | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkCommitMessagePattern "$1" -p "HelloWorld"
npx hook-cli checkCommitMessagePattern .git/COMMIT_EDITMSG -p "HelloWorld"
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld"
npx hook-cli checkCommitMessagePattern -m "I say HelloWorld" -p "HelloWorld" -w

checkForFileChanged

Check if a staged file like a changelog was changed locale or remote compared to another branch

| Option | Description | Type | default | | ------------------- | ------------------------------------------------------------------------ | --------- | ------- | | -b, --branch | Branch to compare to. | string | main | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkForFileChanged CHANGELOG.md
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk
npx hook-cli checkForFileChanged CHANGELOG.md -w
npx hook-cli checkForFileChanged CHANGELOG.md -b trunk -w

checkForVulnerabilities

Runs a package audit and collects the results.

| Option | Description | Type | default | | ------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------- | ---------- | | -m, --package-manager | The package manager you want to use. Keep in mind that both package managers report differently. | yarn, npm | npm | | -l, --audit-level | The severity of the vulnerabilities what the script will report. | info, low, moderate, high, critical | critical | | -p, --prod | If true only run audit for prod dependencies and skip dev ones. | boolean | false | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkForVulnerabilities
npx hook-cli checkForVulnerabilities --package-manager yarn
npx hook-cli checkForVulnerabilities --audit-level low
npx hook-cli checkForVulnerabilities --warn-only
npx hook-cli checkForVulnerabilities --prod
npx hook-cli checkForVulnerabilities -l high -m yarn -w -p

checkPackageVersion

Check if the version field is the same for package.json and package-lock.json

| Option | Description | Type | default | | ------------------- | ------------------------------------------------------------------------ | --------- | ------- | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkPackageVersion

checkPackageVersionInFile

Check if the version field is the same for package.json and file

| Option | Description | Type | default | | ------------------- | ------------------------------------------------------------------------ | --------- | ------- | | -p, --json-path | Path in json file to check | string | `` | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version'
npx hook-cli checkPackageVersionInFile hello.json -p 'path.version' -w

updateReminder

Prints a list of packages that have updates.

| Option | Description | Type | default | | ------------------------- | ------------------------------------------------------------------------------------------------ | ------------- | ------- | | -m, --package-manager | The package manager you want to use. Keep in mind that both package managers report differently. | yarn, npm | npm | | -w, --warn-only | If true only prints warning messages and do not exit with not zero code. | boolean | false |

Example usage
npx hook-cli updateReminder
npx hook-cli updateReminder -m yarn
npx hook-cli updateReminder -w
npx hook-cli updateReminder -m yarn -w

Useful

  • Print help page for command
npx hook-cli [command] --help
  • Test command during development (Exit codes get not correctly forwarded).
npm run hook-cli -- [command]
  • Test command during development with correct exi code.
npx tsx src/index.ts [command]