page-arr

2.0.2 • Public • Published

Install

npm install page-arr@latest

Use

const pagearr = require("page-arr")(9);
let currentPage = 6;
let sumPageNum = 100;

let result = pagearr(currentPage,sumPageNum);
// result:
//
// { pageArr: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
//   lastPage: 100,
//   currentPage: 6 }

result = pagearr(45,100);
// result:
//
// { pageArr: [ 41, 42, 43, 44, 45, 46, 47, 48, 49 ],
//   lastPage: 100,
//   currentPage: 45,
//   prevGroupStartPage: 33 }

LICENSE

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.22latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.22
2.0.10
2.0.00
1.0.20
1.0.10

Package Sidebar

Install

npm i page-arr

Weekly Downloads

2

Version

2.0.2

License

ISC

Unpacked Size

176 kB

Total Files

16

Last publish

Collaborators

  • leogiese