1.1.8 • Published 2 years ago

simple-page-numbers v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago