Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ghpulls

rvagg10MIT1.2.0

Interact with the GitHub pull requests API

github, pulls

readme

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.