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

Readme

Keywords

none

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