0.3.6 • Published 7 years ago

@knight_42/octopus v0.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Octopus

Yet another tiny, dedicated and extensible webhook handler.

Installation

$ npm i @knight_42/octopus

Usage

import octopus from '@knight_42/octopus'
// The listening port can be specified via parameter or `process.env.PORT`
// By default, it is 8080
const hook = new octopus({ port: 10080 })

hook.github({ secret: 'IAmAToken' })
    .subscribe('issues', data => {
        console.log('new issues')
    })
    .subscribe('ping', data => {
        console.log('pong')
    })

hook.gitlab({ path: '/gitlab' })
    .subscribe('push', data => {
        console.log(data.object_kind)
    })
    .subscribe('merge_request_note', data => {
        console.log('new comments')
    })

hook.travisci({ path: '/notification' })
    .subscribe('*', console.log)

All available events can be found at:

And the data callback functions took is the request body (or the payload data for travis-ci) in JSON.

Reference

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago