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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-hooks

v0.0.15

Published

An NPM for git hooks.

Downloads

49

Readme

Hooks

An NPM for git hooks.

Terms

  • hook-module: Any module in npm that meets the hook-module specification.
  • hook-module specification: A set of guidelines that define what it means to be a hook-module. View here.
  • npm: node package manager. This can be (and is) used for more things than node modules.
  • npm-module: a bit of code that can be downloaded via npm.
  • package.json: a required file for npm-modules defined here.

Setup

npm install -g node-hooks

Use

git init
hooks install
hooks add new-hook

How to write a git hooks for Hooks

The hook-module sepcs should cover some of the basics while the hook-module best practices doc will help you avoid trip ups.

Is there a way to search npm for hook-modules only?

Working on that. See the TODO list below.

Commands

hooks install

Installs hooks into the current working directory, seeding the required hooks.json and package.json files if needed.

It will also add node-hooks to the projects project.json devDependencies and node_modules folder so that all developers on the project will use the same hooks even if they don't have node-hooks installed locally.

Options

  • --soft: stops install from adding hooks to the package.json devDependencies and node_modules. This is

hooks uninstall

Uninstall hooks from the current working directory. Removes hooks.json, but does not touch package.json or the node_module directory.

hooks add {hook-module} [options]

Adds an npm module to the local hooks project if the hook module's package.json fits the hook-module specification below. By default the module will be added to the hook specified in the module's package.json "default-hook" parameter and to the project's package.json devDependencies parameter.

Options

  • --hook {GIT HOOK NAME}: this option overrides the hook-module's default-hook parameter.
  • -f, --force: installs a module from npm even if it doesn't meet the hooks-module specification. Requires the --hook option
  • --soft: don't add the module to the package.json

hooks remove {hook-module} [options]

Removes a hook-module from the default hooks.

Options

  • --hook {GIT HOOK NAME}: remove module from specified git hook.
  • --all-hooks: remove the module from all git hooks
  • --hard: Also removes the module from the project's devDependencies parameter.

hooks run {git-hook}

Runs a hook.

To Do

  1. Rework globals
    • ~/.hooks/global: hooks a user wants to run for all their projects
  2. Add hooks skip hook-module to skip globals

Upcoming Commands

globals

  • hooks install --global
  • hooks uninstall --global
  • hooks add --global
  • hooks remove --global
  • hooks run --global

hooks skip {hook-module} [options]

Remove a modules from the project (hooks remove --all-hooks) and forces a skip if its installed on a global level

Options

  • --hook {GIT HOOK NAME}: remove module from specified git hook.
  • --all-hooks: remove the module from all git hooks

hooks list [options]

Lists the module hooks as they are currently set up in the active project

Options

  • --global: Lists the module hooks as they are currently setup in the defaults folder.

hooks search key words

does an npm search for modules tagged git-hooks