JSPM

makerpage

1.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q8644F
  • License ISC

Pagination generator library based on an array of results, start index and limit to page of elements into a page

Package Exports

  • makerpage

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (makerpage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PageMaker-nodejs-library Nodejs library to implement pagination on the applications

This library allows the users implements pagination of any array of elements based on the page number and the limit of elements per page

There is only one function called makePagination, that receives on it's arguments the array to paginate, the page number and the total elements of the page.

The return of the function is a object: results = { content:content, totalPages:totalPage, nextPage: nextPage, actualPage:startParsed, prevPage: previousPage, }

content : Contents of the page 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