pagination-js
v2.0.2
Published
Pagination for nodejs
Downloads
122
Readme
pagination
Pagination for Nodejs
Installation
npm install --save pagination-js
Usage example
route.get('/test', (req, res) => {
let pagination = (new Pagination(req.query, total)).getPagination();
res.json(pagination);
});
Test
- Use postman:
http://localhost:3333/media/test?itemPerPage=16&page=2
- The result:
{
"totalItem": 15,
"page": 2,
"itemPerPage": 16,
"minIndex": 16,
"maxIndex": 32
}