
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
pagination-object-generator
Advanced tools
Generate pagination object.
It does not depend on the library.
##DEMO
##Usage
npm install pagination-object-generator
import pagination from "pagination-object-generator";
const offset = 0;
const limit = 20;
const totalCount = 1000;
const showCount = 4;
const results = pagination(offset, limit, totalCount, showCount);
results = pages:[
{
"offset": 0,
"current": true,
"firstNum": 1,
"secondNum": 20,
"pageNum": 1
},
{
"offset": 20,
"current": false,
"firstNum": 21,
"secondNum": 40,
"pageNum": 2
},
{
"offset": 40,
"current": false,
"firstNum": 41,
"secondNum": 60,
"pageNum": 3
},
{
"offset": 60,
"current": false,
"firstNum": 61,
"secondNum": 80,
"pageNum": 4
}
],
last:{
"index": 50,
"offset": 1000
},
paging:{
"prev": false,
"next": 20
}
FAQs
Generate pagination object.
The npm package pagination-object-generator receives a total of 78 weekly downloads. As such, pagination-object-generator popularity was classified as not popular.
We found that pagination-object-generator 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 how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.