Skip to content

RaphaelDiasc21/PageMaker-nodejs-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

MakerPage

MarkerPage is a npm library to implement simple pagination o JavaScript applications.

With MarkerPage you can implement a pagination out of any array of elements based on the page number and the limit of elements per page.

Usage

With npm installed, run

npm install makerpage
require('markerpage');

const pageableList = markerpage.makePagination(resultSet, start,end);

Parameters

To create a pagination object you just need to call the "makePagination" function, and that receives as arguments the array to paginate, the page number and the total elements of the page.

The return pageable object:

const results = {
  content:content,
  totalPages:totalPage,
  nextPage: nextPage,
  actualPage:startParsed,
  prevPage: previousPage,
}
  • content : Page content.
  • totalPages: Total pages based on the array.
  • nextPage: Next page based on the actualPage, it may be null if the the number of the nextPage be greater than totalPages.
  • actualPage: Actual page requested.
  • PrevPage: Previous page based on the actualPage.

Authors

About

Nodejs library to implement pagination on the applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published