Husky for Node.js Projects

Every contributor to a Node.js 2,131 project runs npm 2,036 install, and Husky 35,333 (github.com/typicode/husky (https://github.com/typicode/husky 35,333 ), MIT, 9.1.7) uses that to close the gap of core.hooksPath: its prepare script runs after each install and sets core.hooksPath. Sam installs it with lint-staged 17.5.1 14,736 , ESLint 10.11.0 39,810 and ESLint's rule and globals packages:

Installing Husky, lint-staged and ESLint, then initializing HuskyShell
npm install --save-dev --silent husky lint-staged eslint @eslint/js globals
npx husky init
cat .husky/pre-commit
git config get core.hooksPath
npm pkg get scripts.prepare
Output
npm test
.husky/_
"husky"

Hook scripts are plain shell in .husky/, committed with the project. The default runs npm test; BookNest's tests need PostgreSQL 1,289 , so Sam replaces it in Husky Pipeline. HUSKY=0 skips the hooks, for example in CI.