Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@salling-group/pagination-traverser
Advanced tools
A library for traversing paginated API resources.
Traverser
helps you paginate through Salling Group API resources
(e.g. the Stores API serves stores in pages).
It relies on a Link
header in responses and will throw an error if none is present.
Traverser
class is required like this:
const Traverser = require('@salling-group/pagination-traverser');
The class is instantiated like this:
const traverser = new Traverser(instance, '/v1/stores/', {
'params': {
'brand': 'netto',
},
});
The parameters for the initialization is:
Parameter | Required | Type | Description |
---|---|---|---|
instance | Yes | Axios instance | An authenticated Axios instance (see NPM module @salling-group/auth). |
resource | Yes | String | The resource to traverse. |
baseOptions | No | Object | Axios options to apply to the requests. |
The Traverser
class has the following methods:
Method | Description |
---|---|
async get() | Get the current page. |
async next() | Move the traverser to the next page and get it. |
async previous() | Move the traverser to the previous page and get it. |
async first() | Move the traverser to the first page and get it. |
async last() | Move the traverser to the last page and get it. |
async goto(page) | Move the traverser to the given page and get it. |
pageNumber() | Get the page that the traverser is on. |
const Traverser = require('@salling-group/pagination-traverser');
const { createInstance } = require('@salling-group/auth');
const instance = createInstance({
'auth': {
'issuer': 'my_issuer',
'secret': 'my_secret',
'type': 'jwt',
},
});
const traverser = new Traverser(instance, '/v1/stores/');
traverser.get().then((firstPage) => {
console.log(firstPage);
traverser.next().then((secondPage) => {
console.log(secondPage);
});
});
FAQs
A library for traversing paginated API resources.
The npm package @salling-group/pagination-traverser receives a total of 0 weekly downloads. As such, @salling-group/pagination-traverser popularity was classified as not popular.
We found that @salling-group/pagination-traverser 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.