
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 5 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.