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

git-at-me

v0.0.2

Published

Yet another GitHub webhook thingy

Downloads

4

Readme

git-at-me

Yet another GitHub Webhook thingy for Node.

Getting Started

var github = require('git-at-me'),
    server = require('express')();

github({
    token: require('./github-token'),
    user: 'jgable',
    repo: 'git-at-me',
    // http://developer.github.com/v3/repos/hooks/#events
    events: ['push', 'pull_request', 'issues', 'release'],
    // The URL that github will post to; should match your site url
    url: 'http://mycoolsite.com/git-at-me/events',
    // More options for configuration documented below
    server: server
}).on('push', function (pushInfo) {
    // Do something with commits
}).on('pull_request', function (prInfo) {
    // Do something with PR
}).on('issue', function (issueInfo) {
    // Do something with issue
}).on('release', function (releaseInfo) {
    // Do something with release
});

/* **Snip all the express configuration** */

server.get('index', function (req, res) {
    res.render('index'); 
});

server.listen();

Getting an API Token

If you don't pass an auth value, git-at-me will attempt to create one for you by asking for your GitHub username and password. The username and password are not stored, but the token will be saved to a file that you can require later (defaults to github-token.js in the current working directory).

If you specify a relative path to a module that exports an API token, it will be used as well.

If you want to do it manually, I've included a simple inquirer driven wizard to help with creating tokens and hooks. This is handy if you don't have access to the Repo you want to add a hook to; just tell the owner of the Repo to run this script to create the necessary web hook.

var gitatme = require('git-at-me');

// This will guide you through making a Token and a Hook for your Repo.
gitatme.wizard();

Check the GitHub API Docs for more information about using the API for authorizations.

Express Server Configuration

By default, git-at-me can create and start an express server, but if you want to pass your own (like from a Hubot.server for instance) you can pass that instead of the server config object.

var github = require('git-at-me');

github({
    token: require('./github-token'),
    user: 'jgable',
    repo: 'git-at-me',
    events: ['push', 'pull_request', 'issues', 'release'],
    url: 'http://mycoolsite.com/git-at-me/events',
    // Passing port instead of server
    port: 3000
}).on('push', function (pushInfo) {
    // Do something with pushed commits
});

License

Licensed under the MIT License, Copyright 2013-2014 Jacob Gable.