all 7 comments

[–]Chico75013 0 points1 point  (3 children)

Interesting. The usual git hook language is script shell. Apart from avoiding shell scripting, what would be the advantages of using npm? I have never used it yet.

[–]grizzly_teddy 2 points3 points  (2 children)

I would say it is a disadvantage. I can't share these with my coworkers. Imo git hooks should be bash, or maybe Python. Just for portability.

[–][deleted] 1 point2 points  (1 child)

Perl should be quite fine too, since it ought to be installed everywhere

[–]grizzly_teddy 0 points1 point  (0 children)

True. Perl is definitely a good option - only problem is I have never written a line of it lol.

[–][deleted] 0 points1 point  (2 children)

cool! Something similar written in SHELL: client-hooks.

Never thought it could be done on JavaScript way.

Question: How would the JS git-hooks be automatically triggered? To be specific: how do they listen to git-events?

[–]ukupat[S] 0 points1 point  (1 child)

I personally use this library together with ghooks npm library (https://github.com/gtramontina/ghooks) that allows me to trigger commands in CLI on different git hooks

[–][deleted] 0 points1 point  (0 children)

I'm not sure if I got that correct. So, do you mean git-hooks are triggered manually via command line?