paginate-array
v2.1.0
Published
Pagination for arrays in javascript
Downloads
2,168
Maintainers
Readme
Array pagination
Simple pagination for arrays in javascript
Installation
npm install paginate-array
Usage
const paginate = require("paginate-array");
const collection = [...];
const paginateCollection = paginate(collection[,pageNumber, numItemsPerPage]);
console.log(paginateCollection)
{
currentPage: 1,
perPage: 10,
total: 20,
totalPages: 2,
data: [...]
}