ghnp
Rx utilites for GitHub Notifications Polling
No knowledge of RxJs is required to use this lib.
Install
npm install --save ghnp
Usage
// A Github token with `repo` and `notifications` scope// https://developer.github.com/apps/building-oauth-apps/scopes-for-oauth-apps/const token = 'GITHUB_TOKEN' const ghnp = const subscription = ghnp // At any point you can stop polling by callingsubscription
Except token used to initialize GHNP
, no other options are required.
// No options are requiredghnp
defaultInterval
does not gaurantee that the requests will be polled
at that interval. X-Poll-Interval
header returned from Github is obeyed and
the highest interval from defaultInterval
and X-Poll-Interval
is used.
As the raw notifications object is a bit cluttered, parseNotifications
can be
used to extract all the usefull informations including the html_url
which
can be used to directly visit the concerned page.
ghnp
See the schema of raw notification object and parsed notification objects.
License
MIT © Siddharth Doshi