# ghpulls

> Interact with the GitHub pull requests API

Latest version **2.0.15** (published 2026-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ghpulls
pnpm add ghpulls
yarn add ghpulls
bun add ghpulls
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.15 |
| Published | 2026-11-04 |
| First published | 2015-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | Rod Vagg |
| Maintainers | rvagg |
| Keywords | github, pulls |

## Links

- npm: https://www.npmjs.com/package/ghpulls
- Repository: https://github.com/rvagg/ghpulls
- Issues: https://github.com/rvagg/ghpulls/pulls
- npm.io page: https://npm.io/package/ghpulls

## Dependencies (1)

- [ghutils](https://npm.io/package/ghutils.md) ^5.0.2

## Recent versions

- 2.0.15 (latest) — 2026-11-04
- 2.0.14 — 2026-10-30
- 2.0.13 — 2026-10-19
- 2.0.12 — 2026-08-05
- 2.0.11 — 2026-08-03
- 2.0.10 — 2026-08-03
- 2.0.9 — 2026-07-30
- 2.0.8 — 2026-07-29
- 2.0.7 — 2026-07-22
- 2.0.6 — 2026-07-08
- 2.0.5 — 2026-06-23
- 2.0.4 — 2026-06-22
- 2.0.3 — 2026-06-04
- 2.0.2 — 2026-04-29
- 2.0.1 — 2026-04-28
- … 5 more at https://npm.io/package/ghpulls/versions

## README

# ghpulls

**A Node.js library to interact with the GitHub pull requests API**

[![NPM](https://nodei.co/npm/ghpulls.svg?style=flat&data=n,v&color=blue)](https://nodei.co/npm/ghpulls/)

## Requirements

- Node.js >= 20

## Example usage

```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](https://github.com/rvagg/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)
})
```

## API

All methods return Promises.

### ghpulls.list(auth, org, repo, options)

List pull requests for an org/user and repo combination.

### ghpulls.listComments(auth, org, repo, num, options)

List review comments for a given pull request number.

### ghpulls.listReviews(auth, org, repo, num, options)

List reviews for a given pull request number.

## Authentication

See [ghauth](https://github.com/rvagg/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.

## See also

* [ghissues](https://github.com/rvagg/ghissues) - interact with the GitHub issues API
* [ghusers](https://github.com/rvagg/ghusers) - interact with the GitHub users API
* [ghteams](https://github.com/rvagg/ghteams) - interact with the GitHub teams API
* [ghrepos](https://github.com/rvagg/ghrepos) - interact with the GitHub repos API
* [ghauth](https://github.com/rvagg/ghauth) - GitHub authentication

## License

**ghpulls** is Copyright (c) 2015-2025 Rod Vagg [@rvagg](https://github.com/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.

---
_Source: https://npm.io/package/ghpulls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
