Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@aboutbits/pagination
Advanced tools
This project includes a pagination calculation, where you can simply pass some basic information to the calcualtion function, and in return you receive an object with all relevant pagination information.
First, you have to install the package:
npm install @aboutbits/pagination
Second, you can call the calculate function by passing the following information:
page
: The current pagesize
: The amount of items shown per pagetotal
: The amount of total items in the list/collectionmaxPages
: The maximum amount of pages that should be shown (default: 5)In return, you receive an object with all relevant information:
import { calculatePagination } from '@aboutbits/pagination'
let pagination = calculatePagination(1, 5, 100)
console.log(pagination)
This would return the following object:
{
"previous": {
"number": 1,
"isDisabled": true
},
"next": {
"number": 2,
"isDisabled": false
},
"pages": [
{
"number": 1,
"isCurrent": true
},
{
"number": 2,
"isCurrent": false
},
{
"number": 3,
"isCurrent": false
},
{
"number": 4,
"isCurrent": false
},
{
"number": 5,
"isCurrent": false
}
]
}
About Bits is a company based in South Tyrol, Italy. You can find more information about us on our website.
For support, please contact info@aboutbits.it.
The MIT License (MIT). Please see the license file for more information.
FAQs
Pagination
The npm package @aboutbits/pagination receives a total of 48 weekly downloads. As such, @aboutbits/pagination popularity was classified as not popular.
We found that @aboutbits/pagination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.