paginate-array-ts
v1.0.0
Published
Pagination for arrays in javascript
Downloads
34
Maintainers
Readme
Array pagination
Simple pagination for arrays in javascript
Installation
npm install paginate-array-ts
Usage
import { paginateArray } from 'paginate-array-ts';
const collection = [...];
const paginateCollection = paginate<T>(collection[,pageNumber, numItemsPerPage]);
The result of paginateCollection will be an object:
{
currentPage: 1,
perPage: 10,
total: 20,
totalPages: 2,
data: [...]
}