npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simple-github-webhook

v0.1.0

Published

A simple, Node.js based webhook for shell-script based deployment

Downloads

1

Readme

Simple GitHub Webhook

A simple, Node.js based webhook meant for shell-script based deployment!

Usage

Step 1. Installing

Let's say you just want to use this for fast and easy deployment for your web project. First thing's first clone this repository and install the required dependencies.

git clone https://github.com/melonmanchan/simple-github-webhook
cd simple-github-webhook
npm install

While you're at it, you should also edit the deploy.sh script to be more suitable for your deployment needs.

Step 2. Starting it up

The webhook takes in the following four parameters, passed in through environment variables:

Variable | Meaning | Default ------------- | ------------- | ------------- SECRET | The GitHub secret for authentication | None (required!) HOOK_PATH | The sub-path that the script runs under | / PORT | The port the script runs under | 8080 BRANCH | The git branch that the webhook is listening for commits | master

So for example, if you'd like to listen to changes to the feature-foo branch on port 1337 and run a script every time someone commits to the branch in question, you'd start the webhook by:

PORT=1337 SECRET='My secret secret' BRANCH='feature-foo' npm start

Output:

GitHub webhook running at: http://10.11.12.13:1337/
Listening for commits to branch refs/heads/feature-foo

Step 2. Setting up your repository on GitHub

First, go to your repository's setting page, click on "Webhooks and services", and click on the button on the top right, labeled "Add webhook"

GitHub will then prompt you for your password.

Next, fill in the correct URL, path and secret that you specified and received while starting the webhook.

That should be enough to get your webhook up and running! Feel free to make a test commit or two to the branch you specified at the start to test it.

Running deployment now...
# SCRIPT OUTPUT HERE
Deployment finished!

License

MIT © Matti Jokitulppo

npm version npm downloads