Home

Awesome

identify-github-event

Map Github webhook events to their names

Features

Installing

npm install --save identify-github-event

Usage

var identifyGithubEvent = require('identify-github-event');

console.log(identifyGithubEvent(event));
// returns the CamelCased name, e.g. PushEvent (or undefined if the event signature is unknown)

console.log(identifyGithubEvent.target(event));
// returns a hash { user: 'name', repo: 'somename', branch: 'somebranch' }

Rebuilding

The mapping.json and event-names.json files are automatically generated via npm prepublish script. To run it manually, run npm run-script prepublish.