{"name":"pre-commit","version":"2.0.0","description":"Automatically install pre-commit hooks for your npm modules.","main":"index.js","scripts":{"coverage":"nyc --reporter=lcov --reporter=text mocha test.js","example-fail":"echo \"This is the example hook, I exit with 1\" && exit 1","example-pass":"echo \"This is the example hook, I exit with 0\" && exit 0","install":"node install.js","test":"mocha test.js","test-travis":"nyc --reporter=lcovonly mocha test.js","uninstall":"node uninstall.js"},"repository":{"type":"git","url":"git://github.com/observing/pre-commit.git"},"keywords":["git","hooks","npm","pre-commit","precommit","run","test","development"],"author":{"name":"Arnout Kazemier","email":"opensource@observe.it"},"homepage":"https://github.com/observing/pre-commit","license":"MIT","publishConfig":{"registry":"https://registry.npmjs.org/"},"engines":{"node":">=16.13.0"},"dependencies":{"cross-spawn":"^7.0.5","which":"^4.0.0"},"devDependencies":{"assume":"^2.3.0","mocha":"^10.4.0","nyc":"^15.1.0"},"gitHead":"ad8d1252e2fb7df1a7ca9b3a8e30d1d6e761e21a","_id":"pre-commit@2.0.0","bugs":{"url":"https://github.com/observing/pre-commit/issues"},"_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-gStVX9Yji5PjN4Yl1/4fSc9LPzwdGkkiSgarug873vfatIH47WIXPa+rcE8FK9JrbsMGuZji2Ih3V+G+Oa8eww==","shasum":"59a955dafb2bc63261f7a755804a904b4cc4d333","tarball":"http://registry-npm.ywwl.com/pre-commit/download/pre-commit-2.0.0.tgz","fileCount":11,"unpackedSize":35873,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBYZ+aT9WjfqfRqBxmhGU2vRv9Dv0vJepQapCntrrxEjAiEA6D3nVF1/rPzEWdzyX52jwxiq0eiRnB3BnvE61oxTcdI="}],"size":12195,"noattachment":false,"key":"/pre-commit/-/pre-commit-2.0.0.tgz"},"_npmUser":{"name":"3rdeden","email":"npmjs@3rd-Eden.com"},"directories":{},"maintainers":[{"name":"swaagie","email":"martijn@swaagman.online"},{"name":"v1","email":"npm@3rd-Eden.com"},{"name":"3rdeden","email":"npmjs@3rd-Eden.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pre-commit_2.0.0_1777386749524_0.19391237491934055"},"_hasShrinkwrap":false,"readme":"# pre-commit\n\n[![Version npm][version]](http://browsenpm.org/package/pre-commit)[![Build Status][build]](https://travis-ci.org/observing/pre-commit)[![Dependencies][david]](https://david-dm.org/observing/pre-commit)[![Coverage Status][cover]](https://coveralls.io/r/observing/pre-commit?branch=master)\n\n[version]: http://img.shields.io/npm/v/pre-commit.svg?style=flat-square\n[build]: http://img.shields.io/travis/observing/pre-commit/master.svg?style=flat-square\n[david]: https://img.shields.io/david/observing/pre-commit.svg?style=flat-square\n[cover]: http://img.shields.io/coveralls/observing/pre-commit/master.svg?style=flat-square\n\n**pre-commit** is a pre-commit hook installer for `git`. It will ensure that\nyour `npm test` (or other specified scripts) passes before you can commit your\nchanges. This all conveniently configured in your `package.json`.\n\nBut don't worry, you can still force a commit by telling `git` to skip the\n`pre-commit` hooks by simply committing using `--no-verify`.\n\n### Installation\n\nIt's advised to install the **pre-commit** module as a `devDependencies` in your\n`package.json` as you only need this for development purposes. To install the\nmodule simply run:\n\n```\nnpm install --save-dev pre-commit\n```\n\nTo install it as `devDependency`. When this module is installed it will override\nthe existing `pre-commit` file in your `.git/hooks` folder. Existing\n`pre-commit` hooks will be backed up as `pre-commit.old` in the same repository.\n\n### Configuration\n\n`pre-commit` will try to run your `npm test` command in the root of the git\nrepository by default unless it's the default value that is set by the `npm\ninit` script.\n\nBut `pre-commit` is not limited to just running your `npm test`'s during the\ncommit hook. It's also capable of running every other script that you've\nspecified in your `package.json` \"scripts\" field. So before people commit you\ncould ensure that:\n\n- You have 100% coverage\n- All styling passes.\n- JSHint passes.\n- Contribution licenses signed etc.\n\nThe only thing you need to do is add a `pre-commit` array to your `package.json`\nthat specifies which scripts you want to have ran and in which order:\n\n```js\n{\n  \"name\": \"437464d0899504fb6b7b\",\n  \"version\": \"0.0.0\",\n  \"description\": \"ERROR: No README.md file found!\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: I SHOULD FAIL LOLOLOLOLOL \\\" && exit 1\",\n    \"foo\": \"echo \\\"fooo\\\" && exit 0\",\n    \"bar\": \"echo \\\"bar\\\" && exit 0\"\n  },\n  \"pre-commit\": [\n    \"foo\",\n    \"bar\",\n    \"test\"\n  ]\n}\n```\n\nIn the example above, it will first run: `npm run foo` then `npm run bar` and\nfinally `npm run test` which will make the commit fail as it returns the error\ncode `1`.  If you prefer strings over arrays or `precommit` without a middle\ndash, that also works:\n\n```js\n{\n  \"precommit\": \"foo, bar, test\"\n  \"pre-commit\": \"foo, bar, test\"\n  \"pre-commit\": [\"foo\", \"bar\", \"test\"]\n  \"precommit\": [\"foo\", \"bar\", \"test\"],\n  \"precommit\": {\n    \"run\": \"foo, bar, test\",\n  },\n  \"pre-commit\": {\n    \"run\": [\"foo\", \"bar\", \"test\"],\n  },\n  \"precommit\": {\n    \"run\": [\"foo\", \"bar\", \"test\"],\n  },\n  \"pre-commit\": {\n    \"run\": \"foo, bar, test\",\n  }\n}\n```\n\nThe examples above are all the same. In addition to configuring which scripts\nshould be ran you can also configure the following options:\n\n- **silent** Don't output the prefixed `pre-commit:` messages when things fail\n  or when we have nothing to run. Should be a boolean.\n- **colors** Don't output colors when we write messages. Should be a boolean.\n- **template** Path to a file who's content should be used as template for the\n  git commit body.\n\nThese options can either be added in the `pre-commit`/`precommit` object as keys\nor as `\"pre-commit.{key}` key properties in the `package.json`:\n\n```js\n{\n  \"precommit.silent\": true,\n  \"pre-commit\": {\n    \"silent\": true\n  }\n}\n```\n\nIt's all the same. Different styles so use what matches your project. To learn\nmore about the scripts, please read the official `npm` documentation:\n\nhttps://docs.npmjs.com/misc/scripts\n\nAnd to learn more about git hooks read:\n\nhttp://githooks.com\n\n### License\n\nMIT\n","publish_time":1777386749659,"_cnpm_publish_time":1777386749659,"dist-tags":{"latest":"2.0.0"}}