Socket
Socket
Sign inDemoInstall

octokit-pagination-methods

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

octokit-pagination-methods

Legacy Octokit pagination methods from v15


Version published
Maintainers
1
Weekly downloads
519,725
decreased by-0.05%
Install size
15.9 kB

Weekly downloads

Readme

Source

octokit-pagination-methods

Legacy Octokit pagination methods from 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

Keywords

FAQs

Last updated on 08 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc