1.0.4 • Published 2 years ago

express-pagination-rbh v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

install dependency for pagination

npm i express-pagination-rbh

In our project we import the pagination dependency as follows.

const list = require('express-pagination-rbh');

in our view we send the following parameters as follows:

where it receives as limitItems the total number of products to display.

where TotalProducts is the total of products.

where page is the page number.

const limitItems = 56;
const TotalProducts= 11328;
const page= 1;

const result = list.pagination(limitItems,TotalProducts,page);

as output it returns the following data:

Image text

where if we change the page to 2 it returns the following data:

Image text

since with the data we can perform the pagination with bootstrap:

example made in express-handlebars.

Image text

Image text

image one example:

Image text

image two example:

Image text

to display the products from the database in the following path:

Image text