Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pagination-count-helper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagination-count-helper

Helper class for page and page item counting

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pagination-count-helper

Description

Helper class for page and page item counting

Usage

const helper = new PaginationHelper(['a','b','c','d','e','f','g','h'], 3);

// retrieve number of pages (1-based)
helper.pageCount()      // 3

// retrieve number of items
helper.itemCount()      // 8

// retrieve number of items on this (as provided by the argument) page (0-based)
helper.pageItemCount(2) // 2

// retrieve number of the page the specified item will be displayed on (item number and page number are 0-based)
helper.pageIndex(7)     // 2

FAQs

Package last updated on 06 Feb 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc