
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
simple-pagination
Advanced tools
Just provides only a simple pagination logic
npm install --save simple-pagination
/*
* Returns pagination result
*
* @param {number} totalCount - Number of items that will be paginated
* @param {number} perPage - Number of items per page
* @param {number} specifiedPage - Page number you wanted to get, it is started by 1
*/
function paginate(totalCount, perPage, specifiedPage) {
};
var assert = require('assert');
var paginate = require('simple-pagination');
assert.deepEqual(
paginate(25, 10, 1), {
totalCount: 25,
perPage: 10,
specifiedPage: 1,
pageCount: 3,
firstPage: 1,
lastPage: 3,
currentPage: 1,
isFirstPage: true,
isLastPage: false,
previousPage: null,
nextPage: 2,
fromCount: 1,
toCount: 10
}
);
assert.deepEqual(
paginate(25, 10, 3), {
totalCount: 25,
perPage: 10,
specifiedPage: 3,
pageCount: 3,
firstPage: 1,
lastPage: 3,
currentPage: 3,
isFirstPage: false,
isLastPage: true,
previousPage: 2,
nextPage: null,
fromCount: 21,
toCount: 25
}
);
// Specified page number is out of range
assert.deepEqual(
paginate(25, 10, 4), {
totalCount: 25,
perPage: 10,
specifiedPage: 4,
pageCount: 3,
firstPage: 1,
lastPage: 3,
// currentPage is different from specifiedPage
currentPage: 3,
isFirstPage: false,
isLastPage: true,
previousPage: 2,
nextPage: null,
fromCount: 21,
toCount: 25
}
);
// If page count is 0, then props are mostly null
assert.deepEqual(
paginate(0, 1, 1), {
totalCount: 0,
perPage: 1,
specifiedPage: 1,
pageCount: 0,
firstPage: null,
lastPage: null,
currentPage: null,
isFirstPage: null,
isLastPage: null,
previousPage: null,
nextPage: null,
fromCount: null,
toCount: null
}
);
FAQs
Just provides only a simple pagination logic
The npm package simple-pagination receives a total of 157 weekly downloads. As such, simple-pagination popularity was classified as not popular.
We found that simple-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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.