pgsn
v1.1.3
Published
pgsn is a node.js utils for handling pagination.
Downloads
13
Maintainers
Keywords
Readme
pgsn Pagination
pgsn is a node.js utils for handling pagination.
Installation
npm install --save pgsn
Usages
const { PGSN } = require("pgsn");
try {
const response = PGSN.getPagingData({
rows: [
{ name: 'test1', email: '[email protected]' },
{ name: 'test2', email: '[email protected]' },
], // rows data must be a array
totalItems: 5, // totalItems must be a number
page: 1, // page must be a number
limit: 2 // limit must be a number
})
console.log(response)
}catch(error) {
console.log(error)
}