Simple pagination for arrays in javascript
npm install paginate-array
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: [...]
}