1.1.8 • Published 8 months ago

simple-page-numbers v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Simple Page Numbers

GitHub, NPM

A simple JavaScript/TypeScript function that generates a spread of page numbers, based on the desired spread and the total number of pages.

For example, if you have 53 pages, and your current page is 21, with a spread of 2 pages, the function will output:

{
    "previousPage": 20,
    "nextPage": 21,
    "totalPages": 53,
    "pages": [
        19,
        20,
        21,
        22,
        23
    ]
}

Usage

You can install this package using NPM.

npm install simple-page-numbers --save-dev

Then use the function in your files.

import { paginate } from "simple-page-numbers";
const pagination = paginate(currentPage, totalPages, spread)

License

Distributed under the MIT license.

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago