Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
git-web-hooks
Advanced tools
A module for reacting to git webhooks.
Example
const GitWebhooks = require('git-web-hooks')
new GitWebhooks({
PORT: 3333 // optional. 3333 is default
}).on('payload', (req, res, payload) => {
// do something based on payload contents
// then send a response to github
res.end('got it!')
})
Commands
Doing something useful with the webhooks probably means you will run some commands. GitWebhooks.command
is a thin wrapper around child_process.exec
that returns a promise. You can use this to run commands like git pull
or npm install
.
var cmd = GitWebhooks.command('echo "running a command now!"')
// it's a Promise!
cmd.then(std => {
console.log(std.out, std.err)
}).catch(err => console.error)
// and you can pass options to child_process.exec
GitWebhooks.command('echo "Hello, options!"', {maxBuffer: 1024*1024})
Daemonize
To keep the process alive, you should use a daemonizer like nohup, forever, pm2, or others.
nohup your-hook-server.js &
forever start your-hook-server.js
pm2 start your-hook-server.js
FAQs
React to git webhooks.
The npm package git-web-hooks receives a total of 8 weekly downloads. As such, git-web-hooks popularity was classified as not popular.
We found that git-web-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.