{"id":15693702,"url":"https://github.com/doowb/typeof-github-event","last_synced_at":"2025-05-08T05:40:34.480Z","repository":{"id":57383602,"uuid":"51950770","full_name":"doowb/typeof-github-event","owner":"doowb","description":"Detect the type of github webhook events.","archived":false,"fork":false,"pushed_at":"2017-05-19T04:01:26.000Z","size":30,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T22:08:51.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-17T19:53:46.000Z","updated_at":"2018-09-29T03:09:45.000Z","dependencies_parsed_at":"2022-08-29T23:11:46.462Z","dependency_job_id":null,"html_url":"https://github.com/doowb/typeof-github-event","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ftypeof-github-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ftypeof-github-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ftypeof-github-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ftypeof-github-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/typeof-github-event/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253009529,"owners_count":21839711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:47:39.086Z","updated_at":"2025-05-08T05:40:34.454Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typeof-github-event [![NPM version](https://img.shields.io/npm/v/typeof-github-event.svg?style=flat)](https://www.npmjs.com/package/typeof-github-event) [![NPM monthly downloads](https://img.shields.io/npm/dm/typeof-github-event.svg?style=flat)](https://npmjs.org/package/typeof-github-event)  [![NPM total downloads](https://img.shields.io/npm/dt/typeof-github-event.svg?style=flat)](https://npmjs.org/package/typeof-github-event) [![Linux Build Status](https://img.shields.io/travis/doowb/typeof-github-event.svg?style=flat\u0026label=Travis)](https://travis-ci.org/doowb/typeof-github-event) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/typeof-github-event.svg?style=flat\u0026label=AppVeyor)](https://ci.appveyor.com/project/doowb/typeof-github-event)\n\n\u003e Detect the type of github webhook events.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save typeof-github-event\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add typeof-github-event\n```\n\n## Usage\n\n```js\nvar events = require('typeof-github-event');\n```\n\n### .typeof\n\nGet the type of github event based on the given payload.\n\n```js\nvar type = events.typeof(payload);\nconsole.log(type);\n//=\u003e commit_comment\n```\n\n### .is\n\nCheck if the payload is a the given event type.\n\n```js\nif (events.is('commit_comment', payload)) {\n  console.log('commit_comment');\n}\n```\n\n### .is{Event}\n\nChecks if the payload is the specific event type.\n\n```js\nif (events.isCommitComment(payload)) {\n  console.log('commit_comment');\n}\n```\n\n## About\n\n### Related projects\n\n* [github-base](https://www.npmjs.com/package/github-base): JavaScript wrapper that greatly simplifies working with GitHub's API. | [homepage](https://github.com/jonschlinkert/github-base \"JavaScript wrapper that greatly simplifies working with GitHub's API.\")\n* [githubbot](https://www.npmjs.com/package/githubbot): Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage… [more](https://github.com/doowb/githubbot) | [homepage](https://github.com/doowb/githubbot \"Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage of plugins to extend functionality for individual implementations.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 18, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ftypeof-github-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Ftypeof-github-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ftypeof-github-event/lists"}