octokit-pagination-methods

WebJar for octokit-pagination-methods

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

octokit-pagination-methods
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

octokit-pagination-methods
WebJar for octokit-pagination-methods
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/gr2m/octokit-pagination-methods

Download octokit-pagination-methods

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/octokit-pagination-methods/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>octokit-pagination-methods</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/octokit-pagination-methods/
implementation 'org.webjars.npm:octokit-pagination-methods:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/octokit-pagination-methods/
implementation ("org.webjars.npm:octokit-pagination-methods:1.1.0")
'org.webjars.npm:octokit-pagination-methods:jar:1.1.0'
<dependency org="org.webjars.npm" name="octokit-pagination-methods" rev="1.1.0">
  <artifact name="octokit-pagination-methods" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='octokit-pagination-methods', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "octokit-pagination-methods" % "1.1.0"
[org.webjars.npm/octokit-pagination-methods "1.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

octokit-pagination-methods

Legacy Octokit pagination methods from @octokit/rest v15

Build Status Coverage Status Greenkeeper badge

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

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 while working at Cloud9 IDE, Inc. It was adopted and renamed by GitHub in 2017.

LICENSE

MIT

Versions

Version
1.1.0