Node.js
Lefthook is available on NPM in the following flavors:
-
lefthook that will install the proper binary:
npm install lefthook --save-dev # or yarn: yarn add -D lefthook
-
@evilmartians/lefthook with pre-bundled binaries for all architectures:
npm install @evilmartians/lefthook --save-dev # or yarn: yarn add -D @evilmartians/lefthook
-
@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 setside-effects-cache = false
in your .npmrc, otherwise the postinstall script of the lefthook package won't be executed and hooks won't be installed.