Node.js

Lefthook is available on NPM in the following flavors:

  1. lefthook that will install the proper binary:

    npm install lefthook --save-dev
    # or yarn:
    yarn add -D lefthook
    
  2. @evilmartians/lefthook with pre-bundled binaries for all architectures:

    npm install @evilmartians/lefthook --save-dev
    # or yarn:
    yarn add -D @evilmartians/lefthook
    
  3. @evilmartians/lefthook-installer that will fetch binary file on installation:

    npm install @evilmartians/lefthook-installer --save-dev
    # or yarn:
    yarn add -D @evilmartians/lefthook-installer
    

Note: If you use pnpm package manager make sure you set side-effects-cache = false in your .npmrc, otherwise the postinstall script of the lefthook package won't be executed and hooks won't be installed.