typeof-github-event

1.0.0 • Public • Published

typeof-github-event NPM version NPM monthly downloads NPM total downloads Linux Build Status Windows Build Status

Detect the type of github webhook events.

Install

Install with npm:

$ npm install --save typeof-github-event

Install with yarn:

$ yarn add typeof-github-event

Usage

var events = require('typeof-github-event');

.typeof

Get the type of github event based on the given payload.

var type = events.typeof(payload);
console.log(type);
//=> commit_comment

.is

Check if the payload is a the given event type.

if (events.is('commit_comment', payload)) {
  console.log('commit_comment');
}

.is{Event}

Checks if the payload is the specific event type.

if (events.isCommitComment(payload)) {
  console.log('commit_comment');
}

About

Related projects

  • github-base: JavaScript wrapper that greatly simplifies working with GitHub's API. | homepage
  • githubbot: Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage… more | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Brian Woodward

License

Copyright © 2017, Brian Woodward. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on May 18, 2017.

Package Sidebar

Install

npm i typeof-github-event

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • doowb