Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

example in readme

  • Loading branch information...
commit 2f4d852036f904dbb8c6da6f696180f1511e779e 1 parent ce7e798
@jfhbrook authored
Showing with 24 additions and 76 deletions.
  1. +24 −0 README.md
  2. +0 −76 test.txt
View
24 README.md
@@ -4,6 +4,7 @@ A github post-commit service hook handler
## example:
+`example.js`
```js
var hook = require('hubhook')();
@@ -27,6 +28,29 @@ hook.on('payload', function (payload) {
});
```
+#### output:
+
+(example with a random repo of mine)
+
+```
+$ node example.js
+{ pusher: { name: 'none' },
+ repository:
+ { name: 'my-little-proxy',
+ size: 168,
+ has_wiki: true,
+ created_at: '2012-09-16T12:08:06-07:00',
+ private: false,
+ watchers: 6,
+ url: 'https://github.com/jesusabdullah/my-little-proxy',
+ fork: false,
+ language: 'JavaScript',
+ pushed_at: '2012-09-23T02:04:52-07:00',
+ id: 5832190,
+
+***snip***
+```
+
## API:
### `var HubHook = require('hubhook')`
View
76 test.txt
@@ -1,76 +0,0 @@
-payload=%7B%22pusher%22%3A%7B%22name%22%3A%22none%22%7D%2C%22repository%22%3A%7B%22name%22%3A%22my-little-proxy%22%2C%22size%22%3A168%2C%22has_wiki%22%3Atrue%2C%22created_at%22%3A%222012-09-16T12%3A08%3A06-07%3A00%22%2C%22private%22%3Afalse%2C%22watchers%22%3A6%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%22%2C%22fork%22%3Afalse%2C%22language%22%3A%22JavaScript%22%2C%22pushed_at%22%3A%222012-09-23T02%3A04%3A52-07%3A00%22%2C%22id%22%3A5832190%2C%22open_issues%22%3A0%2C%22has_downloads%22%3Atrue%2C%22has_issues%22%3Atrue%2C%22description%22%3A%22a%20cute%20little%20http%20proxy%20server%22%2C%22stargazers%22%3A6%2C%22forks%22%3A1%2C%22owner%22%3A%7B%22name%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%7D%2C%22forced%22%3Afalse%2C%22after%22%3A%222d299c6d62ef65d5e252c12bf41bd2b32fc58380%22%2C%22head_commit%22%3A%7B%22modified%22%3A%5B%22lib%2Fmy-little-proxy.js%22%5D%2C%22added%22%3A%5B%5D%2C%22timestamp%22%3A%222012-09-23T02%3A04%3A46-07%3A00%22%2C%22removed%22%3A%5B%5D%2C%22author%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%2Fcommit%2F2d299c6d62ef65d5e252c12bf41bd2b32fc58380%22%2C%22id%22%3A%222d299c6d62ef65d5e252c12bf41bd2b32fc58380%22%2C%22distinct%22%3Atrue%2C%22message%22%3A%22%5Bfix%5D%20typo%2C%20shoutout%20to%20nathan7%22%2C%22committer%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%7D%2C%22deleted%22%3Afalse%2C%22ref%22%3A%22refs%2Fheads%2Fmaster%22%2C%22commits%22%3A%5B%7B%22modified%22%3A%5B%22lib%2Fmy-little-proxy.js%22%2C%22proxy.js%22%5D%2C%22added%22%3A%5B%5D%2C%22timestamp%22%3A%222012-09-17T21%3A50%3A22-07%3A00%22%2C%22removed%22%3A%5B%5D%2C%22author%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%2Fcommit%2Fef7ddb046e5365c7c7ab07d428d604d578314450%22%2C%22id%22%3A%22ef7ddb046e5365c7c7ab07d428d604d578314450%22%2C%22distinct%22%3Atrue%2C%22message%22%3A%22%5Bapi%5D%20renamed%20%5C%22end%5C%22%20to%20%5C%22notFound%5C%22%22%2C%22committer%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%7D%2C%7B%22modified%22%3A%5B%22README.md%22%5D%2C%22added%22%3A%5B%5D%2C%22timestamp%22%3A%222012-09-17T21%3A53%3A13-07%3A00%22%2C%22removed%22%3A%5B%5D%2C%22author%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%2Fcommit%2Fe38cdca88fe0384efb2eb008c1f4ddc067753ea3%22%2C%22id%22%3A%22e38cdca88fe0384efb2eb008c1f4ddc067753ea3%22%2C%22distinct%22%3Atrue%2C%22message%22%3A%22%5Bdoc%5D%20Document%20this.host%20and%20this.notFound%22%2C%22committer%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%7D%2C%7B%22modified%22%3A%5B%22lib%2Fmy-little-proxy.js%22%5D%2C%22added%22%3A%5B%5D%2C%22timestamp%22%3A%222012-09-23T02%3A04%3A46-07%3A00%22%2C%22removed%22%3A%5B%5D%2C%22author%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%2Fcommit%2F2d299c6d62ef65d5e252c12bf41bd2b32fc58380%22%2C%22id%22%3A%222d299c6d62ef65d5e252c12bf41bd2b32fc58380%22%2C%22distinct%22%3Atrue%2C%22message%22%3A%22%5Bfix%5D%20typo%2C%20shoutout%20to%20nathan7%22%2C%22committer%22%3A%7B%22name%22%3A%22Joshua%20Holbrook%22%2C%22username%22%3A%22jesusabdullah%22%2C%22email%22%3A%22josh.holbrook%40gmail.com%22%7D%7D%5D%2C%22before%22%3A%22de49c86861ef469b6faaaf87f55036c77c62e290%22%2C%22compare%22%3A%22https%3A%2F%2Fgithub.com%2Fjesusabdullah%2Fmy-little-proxy%2Fcompare%2Fde49c86861ef...2d299c6d62ef%22%2C%22created%22%3Afalse%7D
-{ pusher: { name: 'none' },
- repository:
- { name: 'my-little-proxy',
- size: 168,
- has_wiki: true,
- created_at: '2012-09-16T12:08:06-07:00',
- private: false,
- watchers: 6,
- url: 'https://github.com/jesusabdullah/my-little-proxy',
- fork: false,
- language: 'JavaScript',
- pushed_at: '2012-09-23T02:04:52-07:00',
- id: 5832190,
- open_issues: 0,
- has_downloads: true,
- has_issues: true,
- description: 'a cute little http proxy server',
- stargazers: 6,
- forks: 1,
- owner: { name: 'jesusabdullah', email: 'josh.holbrook@gmail.com' } },
- forced: false,
- after: '2d299c6d62ef65d5e252c12bf41bd2b32fc58380',
- head_commit:
- { modified: [ 'lib/my-little-proxy.js' ],
- added: [],
- timestamp: '2012-09-23T02:04:46-07:00',
- removed: [],
- author:
- { name: 'Joshua Holbrook',
- username: 'jesusabdullah',
- email: 'josh.holbrook@gmail.com' },
- url: 'https://github.com/jesusabdullah/my-little-proxy/commit/2d299c6d62ef65d5e252c12bf41bd2b32fc58380',
- id: '2d299c6d62ef65d5e252c12bf41bd2b32fc58380',
- distinct: true,
- message: '[fix] typo, shoutout to nathan7',
- committer:
- { name: 'Joshua Holbrook',
- username: 'jesusabdullah',
- email: 'josh.holbrook@gmail.com' } },
- deleted: false,
- ref: 'refs/heads/master',
- commits:
- [ { modified: [Object],
- added: [],
- timestamp: '2012-09-17T21:50:22-07:00',
- removed: [],
- author: [Object],
- url: 'https://github.com/jesusabdullah/my-little-proxy/commit/ef7ddb046e5365c7c7ab07d428d604d578314450',
- id: 'ef7ddb046e5365c7c7ab07d428d604d578314450',
- distinct: true,
- message: '[api] renamed "end" to "notFound"',
- committer: [Object] },
- { modified: [Object],
- added: [],
- timestamp: '2012-09-17T21:53:13-07:00',
- removed: [],
- author: [Object],
- url: 'https://github.com/jesusabdullah/my-little-proxy/commit/e38cdca88fe0384efb2eb008c1f4ddc067753ea3',
- id: 'e38cdca88fe0384efb2eb008c1f4ddc067753ea3',
- distinct: true,
- message: '[doc] Document this.host and this.notFound',
- committer: [Object] },
- { modified: [Object],
- added: [],
- timestamp: '2012-09-23T02:04:46-07:00',
- removed: [],
- author: [Object],
- url: 'https://github.com/jesusabdullah/my-little-proxy/commit/2d299c6d62ef65d5e252c12bf41bd2b32fc58380',
- id: '2d299c6d62ef65d5e252c12bf41bd2b32fc58380',
- distinct: true,
- message: '[fix] typo, shoutout to nathan7',
- committer: [Object] } ],
- before: 'de49c86861ef469b6faaaf87f55036c77c62e290',
- compare: 'https://github.com/jesusabdullah/my-little-proxy/compare/de49c86861ef...2d299c6d62ef',
- created: false }
Please sign in to comment.
Something went wrong with that request. Please try again.