New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@locustjs/pagination

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locustjs/pagination

This library provides utilities regarding paging and pagination for data grids

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
0
Created
Source

@locustjs/pagination

This library provides utilities regarding paging and pagination for data grids.

Install

npm i @locustjs/pagination

The library contains a pagingCalc function that helps calculating paging based on a given recordcount, pagesize and current page.

Example:

import { pagingCalc } from 'locustjs-pagination';

const pageSize = 8;
const recordCount = 456;
const currentPage = 20;
const visiblePages = 6;

const paging = pagingCalc(currentPage, recordCount, pageSize, visiblePages);

console.log(paging);
/*
  result:
  {
    fromPage: 19
    fromRow: 153
    page: 20
    pageCount: 57
    pageSize: 8
    recordCount: 456
    toPage: 24
    toRow: 160
    visiblePages: 6
  }
*/

Keywords

locustjs

FAQs

Package last updated on 20 Jun 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