gh-user-pushes
v1.0.1
Published
Get the list of recent pushes to Github repositories by a user
Downloads
6
Maintainers
Readme
gh-user-pushes
Get the list of recent pushes to Github repositories by a user
const ghUserPushes = require('gh-user-pushes');
ghUserPushes('shinnn').then(pushEvents => console.log(pushEvents));
[
{
id: '3410030270',
type: 'PushEvent',
actor: {
id: 1131567,
login: 'shinnn',
gravatar_id: '',
url: 'https://api.github.com/users/shinnn',
avatar_url: 'https://avatars.githubusercontent.com/u/1131567?'
},
repo: {
id: 24991563,
name: 'shinnn/read-json-sync',
url: 'https://api.github.com/repos/shinnn/read-json-sync'
},
payload: {
push_id: 890833539,
size: 1,
distinct_size: 1,
ref: 'refs/heads/master',
head: '8c8359c6287e5a770ddbc0fee2a234e18388d2b1',
before: '29847966fe98fa450e865ff9fe92096ca1f45fe0',
commits: [
{
sha: '8c8359c6287e5a770ddbc0fee2a234e18388d2b1',
author: {
email: '[email protected]',
name: 'Shinnosuke Watanabe'
},
message: 'use Node v5.x on AppVeyor',
distinct: true,
url: 'https://api.github.com/repos/shinnn/read-json-sync/commits/8c8359c6287e5a770ddbc0fee2a234e18388d2b1'
}
]
},
public: true,
created_at: '2015-12-04T18:16:39Z'
},
// ...
]
Installation
npm install gh-user-pushes
API
const ghUserEvents = require('gh-user-pushes');
ghUserPushes(username [, options])
username: String
(a Github username, for example https://github.com/shinnn → 'shinnn'
)
options: Object
(gh-user-events options)
Return: Promise
instance
It has almost the same API as gh-user-events's, except that it only gets PushEvent
items.
License
Copyright (c) 2015 - 2016 Shinnosuke Watanabe
Licensed under the MIT License.