New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/git-hooks

Package Overview
Dependencies
Maintainers
36
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/git-hooks

No nonsense Git hook management

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
36
Created
Source

@vercel/git-hooks

No nonsense Git hook management.

Usage

Install this module, preferably as a dev-dependency:

yarn add --dev @vercel/git-hooks

That's it. You can now use the module in two ways:

{
  "scripts": {
    "git-pre-commit": "eslint"
  }
}

The above will run a single command line, just like running npm run git-pre-commit or yarn git-pre-commit, every time you git commit.

Alternatively, if you'd like to run several scripts in succession upon a hook, you may define a git top-level property and specify an array of scripts to run:

{
  "git": {
    "pre-commit": "lint"
  }
}

or

{
  "git": {
    "pre-commit": ["lint", "test"]
  }
}

Note that any "scripts" hooks supplant any corresponding "git" hooks. That is to say, if you define both a {"scripts": {"git-pre-commit": "..."}} hook and a {"git": {"pre-commit": []}} hook, the hook in "scripts" will be the only hook that is executed.

Why? There are hundreds of these.

  • No dependencies
  • Supports NPM, Yarn, <insert package manager> - this package will detect and use whatever package manager you installed it with*
  • Tiny footprint - two script files and a couple of symlinks
  • Existing hook / anti-overwrite checks are very reliable since two proprietary scripts are added and all of 'our' hooks are just symlinks to those, so there's virtually no way the uninstall script will mistake a pre-existing hook for its own

*Caveat: The package manager needs to be npm compliant in terms of environment variables. Worst case, define the environment variables npm_node_execpath (node binary) and npm_execpath (package manager entry point) as environment variables prior to installing.

License

Copyright © 2021 by Vercel, Inc.

Released under the MIT License.

FAQs

Package last updated on 10 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc