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

@moulibheemaneti/commitguard

v0.1.4

Published

A CLI tool to manage Git hooks (pre-commit, commit-msg, pre-push) in any Node.js / JS / TS project. Similar to husky and lefthook.

Readme

commitguard

A CLI tool to manage Git hooks (pre-commit, commit-msg, pre-push, and more) in any Node.js / JS / TS project — configured via a simple YAML file. Inspired by dart_husky.


Project Plan

What it does

commitguard reads a commitguard.yaml file in your project root and installs shell scripts into .git/hooks/. When Git triggers a hook, the shell script calls commitguard run <hook-name>, which reads the config and executes the commands you defined.

Source structure

src/
  config/
    config-model.ts         — TypeScript types: GitHooksConfig, HookType, CommandConfig, etc.
    config-parser.ts        — Reads and parses commitguard.yaml using Bun.YAML (no external deps)
  hooks/
    commit-msg-validator.ts — Validates commit messages against Conventional Commits spec
    hook-installer.ts       — Writes / deletes shell scripts in .git/hooks/
    hook-runner.ts          — Executes commands for a given hook (sequential / parallel, staged-only, glob filtering)
  utils/
    git-utils.ts            — getStagedFiles() via `git diff --cached --name-only`
  cli/
    commands/
      install.ts            — `commitguard install`   — reads config, installs hook scripts
      uninstall.ts          — `commitguard uninstall` — removes hook scripts
      run.ts                — `commitguard run <hook>` — called by the installed git hook scripts
      list.ts               — `commitguard list`      — shows configured hooks and install status
  cli.ts                    — Main CLI entry point (bin), parses process.argv
  index.ts                  — Public library export (CommitMsgValidator, types)

Config file: commitguard.yaml

Same shape as dart_husky.yaml. Example:

commitguard:
  verbose: true
  staged_only: false

pre-commit:
  parallel: false
  commands:
    lint:
      run: bunx eslint .
      glob: "**/*.ts"
    format:
      run: bunx prettier --check .
      staged_only: false

commit-msg:
  commands:
    conventional:
      preset: conventional
      types:
        append: [wip, release]

Supported hooks

| Hook | Triggered when | |-------------------|-----------------------------------| | pre-commit | Before a commit is created | | commit-msg | To validate the commit message | | pre-push | Before pushing to remote | | post-checkout | After switching branches | | pre-merge-commit| Before a merge commit |

CLI commands

| Command | Description | |-------------------------------|------------------------------------------| | commitguard install | Install git hooks from commitguard.yaml | | commitguard uninstall | Remove all installed git hooks | | commitguard run <hook-name> | Run a specific hook manually | | commitguard list | List all configured hooks and status |

Key design decisions

  • Zero external runtime dependencies — uses Bun.YAML.parse for YAML and new Bun.Glob().match() for glob filtering
  • Generated hook scripts call npx commitguard run <hook-name> so they work in any Node.js environment after install
  • commit-msg preset conventional validates against the Conventional Commits spec with optional type appending or overriding
  • staged_only can be set globally or per-command; when enabled, staged file paths are appended to the run command
  • parallel runs all commands in a hook concurrently using Promise.all

Usage (once published)

# Install as a dev dependency
npm install -D commitguard

# Create commitguard.yaml in your project root
# Then install the git hooks
npx commitguard install

Development

# Install dependencies
bun install

# Build for npm
bun run build

# Run tests
bun test