# locustjs-pagination

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

Latest version **1.0.1** (published 2021-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install locustjs-pagination
pnpm add locustjs-pagination
yarn add locustjs-pagination
bun add locustjs-pagination
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-02-21 |
| First published | 2020-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Iron Code |
| Maintainers | mansoor-omrani |
| Keywords | locustjs, javascript, pagination, paging |

## Links

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

## Dependencies (1)

- [locustjs-base](https://npm.io/package/locustjs-base.md) ^1.0.5

## Recent versions

- 1.0.1 (latest) — 2021-02-21
- 1.0.0 — 2020-06-16

## README

# locustjs-pagination
This library provides utilities regarding paging and pagination for data grids.

The library contains a pagingCalc() function that helps calculating paging based on a given recordcount, pagesize and current page.

Here is an example:

```javascript
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
  }
*/
```

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