天天看點

[NPM] Run npm scripts with git hooks

In this lesson we will look about how we can integrate with git hooks to help enforce a certain level of quality before you either commit your code or push to a remote repository.

Install:

Add script:

For each commit:

This will run before each commit.

For each push:

This will run before each push.

But if for some reason, if you want bypass the precommit or prepush check, you can do: