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

git-install-hook

v0.0.10

Published

Git hook to install dependencies on branch change or after a merge whenever the lock file changes

Downloads

335

Readme

git-install-hook

Install dependencies automatically when you change branches or merge and some new dependencies have been added or removed.

Made to be used with the post-checkout and post-merge hooks.

It detects the package manager automatically and installs the dependencies. You can prompt the user if you want to install the dependencies on change.

git-install-hook example

Supported package managers

Install

# npm
npm install --save-dev git-install-hook

# yarn
yarn add -D git-install-hook

# pnpm
pnpm add -D git-install-hook

Usage

The command is supposed to run with simple-git-hooks or husky.

Basic usage in terminal

# run normally
git-install-hook

# Ask if you want to install the dependencies on change
git-install-hook --prompt

# show spinner instead of installation output
git-install-hook --installation spinner

# don't show information text output
git-install-hook --no-text

simple-git-hooks

Install simple-git-hooks and initialize it. After that you can add the hooks to your package.json. Below example is for pnpm. For npm and yarn you can use npx or yarn instead of pnpm exec.

"simple-git-hooks": {
    "post-checkout": "pnpm exec git-install-hook",
    "post-merge": "pnpm exec git-install-hook --prompt"
}

Run the simple-git-hooks command to install the hooks:

# npm
npx simple-git-hooks

# yarn
yarn simple-git-hooks

# pnpm
pnpm exec simple-git-hooks

husky

Run the prepare script to install the hooks:

# npm
npx husky install

# yarn
yarn husky install

# pnpm
pnpm dlx husky install

Add the post-checkout or the post-merge hook:

# npm
npx husky add .husky/post-checkout "npx git-install-hook"

# yarn
yarn husky add .husky/post-checkout "yarn git-install-hook"

# pnpm
pnpm dlx husky add .husky/post-checkout "pnpm exec git-install-hook"

Flags

  • --prompt - Ask if you want to install the dependencies on change.
  • --debug - Show debug messages.
  • --installation - Installation output. Can be show, hide or spinner. Default is show.
  • --no-text - Don't show information text output.