Interact with the GitHub pull requests API
npm install ghpullsA Node.js library to interact with the GitHub pull requests API

- Node.js >= 20
``js
import * as ghpulls from 'ghpulls'
const auth = { token: 'your-github-token' }
// list all pull requests in a repo
const pulls = await ghpulls.list(auth, 'rvagg', 'jsonist')
console.log(pulls)
// list review comments on a pull request
const comments = await ghpulls.listComments(auth, 'rvagg', 'jsonist', 42)
console.log(comments)
// list reviews on a pull request
const reviews = await ghpulls.listReviews(auth, 'rvagg', 'jsonist', 42)
console.log(reviews)
`
The auth data is compatible with ghauth so you can connect them together:
`js
import ghauth from 'ghauth'
import * as ghpulls from 'ghpulls'
const auth = await ghauth({
configName: 'pulls-lister',
scopes: ['user']
})
const pulls = await ghpulls.list(auth, 'rvagg', 'node-levelup')
console.log('Pull requests in rvagg/node-levelup:')
pulls.forEach((p) => {
console.log('#%s: %s', p.number, p.title)
})
`
All methods return Promises.
List pull requests for an org/user and repo combination.
List review comments for a given pull request number.
List reviews for a given pull request number.
See ghauth for an easy way to obtain and cache GitHub authentication tokens. The auth` object returned by ghauth is directly compatible with all ghpulls methods.
* ghissues - interact with the GitHub issues API
* ghusers - interact with the GitHub users API
* ghteams - interact with the GitHub teams API
* ghrepos - interact with the GitHub repos API
* ghauth - GitHub authentication
ghpulls is Copyright (c) 2015-2025 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.