Pagination Utility
Intro
Pagination Utility is based on the KISS (Keep it Simple, Stupid) principle. It is a simple library which can help you out to make pagination functionality in an easy way.
Install
$ npm install pagination-utility --save
Usage
; // @returns { limit, offset }const limit offset = PaginationUtility; // Do stuff...// - Get collection from database using limit and offset (this should return the total of items, it will be used in the next step) // @return totalPagesconst totalPages = PaginationUtility // return// {// collection,// currentPage,// perPage,// totalPages// }