1.2.0 • Published 8 years ago

ghpulls v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

ghpulls

Build Status

A node library to interact with the GitHub pull requests API

NPM

Example usage

const ghpulls     = require('ghpulls')
    , authOptions = { user: 'rvagg', token: '24d5dee258c64aef38a66c0c5eca459c379901c2' }

// list all pulls in a repo
ghpulls.list(authOptions, 'rvagg', 'jsonist', function (err, pullslist) {
  // Array of pulls data for 'rvagg/jsonist'
  console.log(pullslist)
})

The auth data is compatible with ghauth so you can just connect them together to make a simple command-line application:

const ghauth      = require('ghauth')
    , ghpulls    = require('ghpulls')
    , authOptions = {
          configName : 'pulls-lister'
        , scopes     : [ 'user' ]
      }

ghauth(authOptions, function (err, authData) {
  ghpulls.list(authData, 'rvagg', 'node-levelup', function (err, list) {
    console.log('Pull requests in rvagg/node-levelup:')
    list.forEach(function (i) {
      console.log('#%s: %s', i.number, i.title) 
    })
  })
})

There is also a ghpulls.listComments(auth, org, repo, num, options, callback) API for review comments, currently doesn't seem like the end-point is quite complete, however.

License

ghpulls is Copyright (c) 2015 Rod Vagg @rvagg and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago