npm install headless-paginator
- first(): 1
- last({total: number, limit: number}): number
- next({total: number, limit: number, pos: number}): number
- prev({pos: number}): number
- range({total: number, limit: number, pos: number, range: number}): {start: number, end: number}
total
items total count
limit
items on one page
pos
current page number(1 to n)
range
navigator range
{
total: 81,
limit: 10,
pos: 7,
range: 5
}
[1] [2] [3] [4] [5]
[6] [7] [8] [9]
range(...)
// {start: 6, end: 9}
next(...)
// 8
next(...)
// 9
next(...)
// 9
prev(...)
// 8
first()
// 1
last(...)
// 9
MIT