# octokit-pagination-methods

> Legacy Octokit pagination methods from v15

Latest version **1.1.0** (published 2018-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install octokit-pagination-methods
pnpm add octokit-pagination-methods
yarn add octokit-pagination-methods
bun add octokit-pagination-methods
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-11-08 |
| First published | 2018-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gregor Martynus |
| Maintainers | gr2m |
| Keywords | octokit, github, api, rest, plugin |

## Links

- npm: https://www.npmjs.com/package/octokit-pagination-methods
- Repository: https://github.com/gr2m/octokit-pagination-methods
- Homepage: https://github.com/gr2m/octokit-pagination-methods#readme
- Issues: https://github.com/gr2m/octokit-pagination-methods/issues
- npm.io page: https://npm.io/package/octokit-pagination-methods

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-11-08
- 1.0.0 — 2018-11-08

## README

# octokit-pagination-methods

> Legacy Octokit pagination methods from v15

[![Build Status](https://travis-ci.com/gr2m/octokit-pagination-methods.svg?branch=master)](https://travis-ci.com/gr2m/octokit-pagination-methods)
[![Coverage Status](https://coveralls.io/repos/gr2m/octokit-pagination-methods/badge.svg?branch=master)](https://coveralls.io/github/gr2m/octokit-pagination-methods?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/gr2m/octokit-pagination-methods.svg)](https://greenkeeper.io/)

Several pagination methods such as `octokit.hasNextPage()` and `octokit.getNextPage()` have been removed from `@octokit/request` in v16.0.0 in favor of `octokit.paginate()`. This plugin brings back the methods to ease the upgrade to v16.

## Usage

```js
const Octokit = require('@octokit/rest')
  .plugin('octokit-pagination-methods')
const octokit = new Octokit()

octokit.issues.getForRepo()

  .then(async response => {
    // returns true/false
    octokit.hasNextPage(response)
    octokit.hasPreviousPage(response)
    octokit.hasFirstPage(response)
    octokit.hasLastPage(response)

    // fetch other pages
    const nextPage = await octokit.getNextPage(response)
    const previousPage = await octokit.getPreviousPage(response)
    const firstPage = await octokit.getFirstPage(response)
    const lastPage = await octokit.getLastPage(response)
  })
```

## Credit

These methods have originally been created for `node-github` by [@mikedeboer](https://github.com/mikedeboer)
while working at Cloud9 IDE, Inc. It was adopted and renamed by GitHub in 2017.

## LICENSE

[MIT](LICENSE)

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