Skip to content

Commit 1233ccb

Browse files
committed
added '*' event
1 parent d42431a commit 1233ccb

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Object.keys(events).forEach(function (event) {
6262
})
6363
```
6464

65+
Additionally, there is a special `'*'` even you can listen to in order to receive _everything_.
66+
6567
## License
6668

6769
**github-webhook-handler** is Copyright (c) 2014 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT License. All rights not explicitly granted in the MIT License are reserved. See the included [LICENSE.md](./LICENSE.md) file for more details.

github-webhook-handler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ function create (options) {
7272
res.writeHead(200, { 'content-type': 'application/json' })
7373
res.end('{"ok":true}')
7474

75-
handler.emit(event, {
75+
var emitData = {
7676
event : event
7777
, id : id
7878
, payload : obj
7979
, url : req.url
80-
})
80+
}
81+
82+
handler.emit(event, emitData)
83+
handler.emit('*', emitData)
8184
}))
8285
}
8386
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"dependencies": {
20-
"bl": "~0.8.0"
20+
"bl": "~0.9.4"
2121
},
2222
"devDependencies": {
2323
"tape": "~2.12.3",

0 commit comments

Comments
 (0)