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

@mazhu/githooks

v1.0.0

Published

Simple Git hooks manager with sharing and reuse support

Readme

@mazhu/githooks

Simple Git hooks manager with sharing and reuse support

Features

  • 🚀 Easy Git hooks management — init, add, list, run, install
  • 📦 Built-in hook templates — lint-staged, commit-msg, pre-push
  • 🔄 Share and reuse hooks across projects
  • ⚡ Zero dependencies (except commander.js)
  • 🎨 Colored output for better readability

Quick Start

# Install globally
npm install -g @mazhu/githooks

# Initialize in your project
cd your-project
githooks init

# Add a built-in hook
githooks add lint-staged --builtin lint-staged

# Add a custom hook
githooks add my-check --type pre-commit --command "npm run lint"

# List all hooks
githooks list

# Manually run a hook
githooks run my-check

# Install hooks to .git/hooks
githooks install

# Export a hook for sharing
githooks share my-check -o my-check.hook.json

Commands

githooks init

Initialize .githooks directory in the current project. Creates:

  • .githooks/githooks.json — Configuration file
  • Adds .githooks/ to .gitignore

githooks add <name>

Add a new hook. Options:

  • -t, --type <type> — Hook type (pre-commit, commit-msg, pre-push, etc.)
  • -c, --command <cmd> — Command to run in the hook
  • --builtin <name> — Use a built-in hook template
# Using a built-in template
githooks add lint --builtin lint-staged

# Custom hook
githooks add test --type pre-push --command "npm test"

githooks list

List all configured hooks with their type, command, and status.

githooks run <name>

Manually run a hook by name. Useful for testing before installing.

githooks install

Install all enabled hooks to .git/hooks. Options:

  • -f, --force — Force overwrite existing hooks

githooks share <name>

Export a hook as a JSON file for sharing. Options:

  • -o, --output <path> — Output file path (default: ./<name>.hook.json)

Built-in Hooks

| Name | Type | Command | Description | |------|------|---------|-------------| | lint-staged | pre-commit | npx lint-staged | Run linters on staged files | | commit-msg | commit-msg | npx commitlint --edit $1 | Validate commit messages | | pre-push | pre-push | npm test | Run tests before pushing |

Configuration

Hooks are stored in .githooks/githooks.json:

{
  "version": "1.0.0",
  "hooks": {
    "lint": {
      "type": "pre-commit",
      "command": "npx lint-staged",
      "enabled": true
    },
    "test": {
      "type": "pre-push",
      "command": "npm test",
      "enabled": true
    }
  }
}

Hook Types

All standard Git hook types are supported:

pre-commit, commit-msg, pre-push, pre-rebase, prepare-commit-msg, post-commit, post-checkout, post-merge, post-rewrite, pre-applypatch, applypatch-msg, and more.

License

MIT © mazhu