Nicely Presented Misnomer

    headless-paginator
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.1 • Public • Published

    headless-paginator Build Status

    npm

    Install

    npm install headless-paginator

    API

    • 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}

    Arguments

    total

    items total count

    limit

    items on one page

    pos

    current page number(1 to n)

    range

    navigator range


    example

    {
        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

    license

    MIT

    Install

    npm i headless-paginator

    DownloadsWeekly Downloads

    85

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    4.87 kB

    Total Files

    5

    Last publish

    Collaborators

    • deptno