
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.
github-watchify
Advanced tools
Polls a github repo and returns a list of any changed files. Think of it as a post-commit webhook for repos you don't own.
Github-watchify is a node module that will poll a github repo and notify you of any changed files. Think of it as a post-commit webhook for repos you don't own.
npm install --save github-watchify
##Authentication The library requires the use of personal access tokens for github because it completely removes the need for github passwords to be stored, even in environment vars. Learn more about creating personal access tokens here.
First things first, require the module and create a new instance. When creating a watcher, you'll have to supply a user agent string, which github requires for all API calls, as well as the token mentioned in the Authentication section.
const Watchify = require('./github-watchify');
const watcher = new Watchify({
userAgent: 'github-watchify', //unique user agent string required by github
token: 'A_KEWL_GITHUB_TOKEN'
});
Then we can have some fun. Here I'm polling http://github.com/elifitch/test-repo
for changes every 10 seconds. There's an onPing
function that executes every time the watcher checks the repo for any new commits and supplies the latest commit sha as an argument. The fun happens in the onCommit
function which executes every time the watcher detects a new commit. The function provides a commit comparison, as well as a list of all the files that were changed in the commit.
watcher.watch({
targetUser: 'elifitch',
targetRepo: 'test-repo',
interval: 10000,
onCommit: function(commit, changedFiles) {
console.log(changedFiles);
},
onPing: function(commitSha) {
console.log(commitSha);
}
});
#Party Time ᕕ( ᐛ )ᕗ
FAQs
Polls a github repo and returns a list of any changed files. Think of it as a post-commit webhook for repos you don't own.
The npm package github-watchify receives a total of 3 weekly downloads. As such, github-watchify popularity was classified as not popular.
We found that github-watchify 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.