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

github-listener

v4.1.7

Published

A Node.js continuous deployment system for Github

Downloads

41

Readme

Github Listener

NPM Version Build Status Dependency Status Maintainability Test Coverage

A Node.js continuous deployment system for Github and TravisCI. It detects a hook from Github when a repo is pushed, or from Travis when tests are complete, and pulls the changes in the server side repo using github-getter. Then it runs the script in post-receive to build and push live.

An example setup script that we use to set up the deployment system can be found here.

Installation

$ npm install -g github-listener

Help

Usage: github-listener [options]

-h|--help      display this help message
-v|--version   display the version number
-q|--quiet     suppress logging
-p|--port      port to run Github Listener on
-c|--config    path to JSON config file (default ./config.json)

Config

A config.json file is needed to tell the server what commands are run and the secret used in the Github or Travis hook.

Example:

{
  "processing": "/home/git/deploy/processing",
  "repo_dir": "/home/git/deploy/repos",
  "getter": "/home/git/deploy/github-getter/get.sh {repo_dir} {output} {repo} {branch}",
  "post_receive": "/home/git/deploy/post-receive/bin/post-receive -p {dir}",
  "github_secret": "secret_github_secret",
  "travis_token": "secret_travis_token",
  "url_secret": "secret_url_secret"
}

Setting up webhooks

In order for your listener to receive payloads you need to set up a webhook on Github or Travis:

  • Github - follow the instructions here and put the webhook secret in config.json as github_secret
  • Travis - follow the instructions here and put your user token in config.json as travis_token

If the service you are using does not sign the payloads or provide authorisation headers, you can use the url_secret option and add a ?secret= to the webhook url.

URL Parameters

  • secret - verify payload if URL secret in config.json matches this
  • branch - run build if branch in payload matches this (defaults to master if omitted)
  • semver - run build if branch in payload matches semver (e.g. v1.2.3)

Example: https://git.example.com/?semver&secret=pass1234&branch=dev

Documentation

See the DOCUMENTATION.md file.

Contributing

  1. Create an issue with your bug or suggestion
  2. Fork the repository
  3. Make your changes in your fork
  4. Create a pull request here, referencing the original issue

Testing

npm test will run some tests which cover the majority of the functionality. You can also send test payloads to a server with the payload.js program to test the front end: ./payload.js --help.

npm start will start the server.

License

See the LICENSE file.