Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
just-my-pagination
Advanced tools
A simple pagination module that returns HTML pagination links for your front-end projects.
A simple pagination module that returns HTML pagination links for your front-end projects.
Pagination links are returned as /pageUri/pageNumber/
.
By default Just My Paginatuon supports Google Material Icons for navigation arrows. If you want to use them don't forget to include in your pages the relative icon font and CSS.
$ npm install just-my-pagination
This server side code:
var options = {
pName: 'example', /*Page path*/
total: 500, /*Total number of results*/
page: 1, /*Actual page number*/
query: req.query, /* Query String*/
limit: 20, /* Results per page*/
}
pagination = require('just-my-pagination').getPagination(options);
Returns client side:
<div id="pagination">
<span>
<a href="/example/1/?order=date&sort=desc"><i class="material-icons">first_page</i></a>
</span>
<span>
<a href="/example/3/?order=date&sort=desc"><i class="material-icons">chevron_left</i></a>
</span>
<a href="/example/1/?order=date&sort=desc">1</a>
<a href="/example/2/?order=date&sort=desc">2</a>
<a href="/example/3/?order=date&sort=desc">3</a>
<strong>4</strong>
<a href="/example/5/?order=date&sort=desc">5</a>
<a href="/example/6/?order=date&sort=desc">6</a>
<a href="/example/7/?order=date&sort=desc">7</a>
<span>
<a href="/example/5/?order=date&sort=desc"><i class="material-icons">chevron_right</i></a>
</span>
<span>
<a href="/example/25/?order=date&sort=desc"><i class="material-icons">last_page</i></a>
</span>
</div>
Prop | Description | Default |
---|---|---|
pName | Absolute path of the page where you want to use JMP. | None |
total | Total number of results showed per page (required to calculate how many page there is). | None |
limit | How many results you show per page (required to calculate how many page there is). | None |
page | Actual page number. As you can see in above example it's wrapped in a strong tag. | None |
query | URL query string to pass throug pages. | None |
pagID | (Optional) HTML ID property name of pagination block. | pagination |
firstPage | (Optional) HTML of first page link. | <i class="material-icons">first_page</i> |
prevPage | (Optional) HTML of previous page link. | <i class="material-icons">chevron_left</i> |
nextPage | (Optional) HTML of next page link. | <i class="material-icons">chevron_left</i> |
lastPage | (Optional) HTML of last page link. | <i class="material-icons">last_page</i> |
range | (Optional) Number of links before and after actual page number. | 3 |
FAQs
A simple pagination module that returns HTML pagination links for your front-end projects.
We found that just-my-pagination demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.