
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
multi-sitemap
Advanced tools
Painless creation of large dynamic sitemaps that consist of multiple files.
Painless creation of large dynamic sitemaps that consist of multiple files.
SitemapWriterXml
, SitemapWriterTxt
or build your own.import {SitemapProcessor, SitemapWriterXml} from 'multi-sitemap';
(async () => {
const writer = new SitemapWriterXml({directory: './static/sitemap'});
const processor = new SitemapProcessor({writer});
await processor.addStatic({
name: 'pages',
entries: ['/', '/about']
});
await processor.addDynamic({
name: 'products',
reader: new SitemapProductsReader()
});
await processor.addIndex();
})();
All methods of SitemapProcessor
return promises that should be waited for before calling other methods. The addIndex
method should be called last, as this is the time the processor knows about all child sitemaps.
Create a reader class that implements the following interface:
interface ISitemapReader {
hasNext(): boolean;
getNext(): Promise<SitemapEntryConfig[]>;
}
// Given the following types:
type SitemapEntryConfig = /* url */ string | ISitemapEntry;
interface ISitemapEntry {
url: string;
lastModified?: Date;
changeFrequency?:
| 'always'
| 'hourly'
| 'daily'
| 'weekly'
| 'monthly'
| 'yearly'
| 'never';
priority?: number;
}
An instance of such a class can be passed to the sitemap processor. An example would be:
/**
* Fetches 7 pages of products, each consisting
* of 20 entities that are written to a sitemap.
*/
class SitemapProductsReader {
i = 0;
hasNext() {
return this.i < 7;
}
getNext() {
const size = 20;
const offset = this.i * size;
this.i++;
return fetch(`/api/products?offset=${offset}&size=${size}`)
.then(products => products.map(product => `/products/${product.id}`))
}
}
processor.addDynamic({
name: 'products',
reader: new SitemapProductsReader()
});
FAQs
Painless creation of large dynamic sitemaps that consist of multiple files.
The npm package multi-sitemap receives a total of 368 weekly downloads. As such, multi-sitemap popularity was classified as not popular.
We found that multi-sitemap 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 uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.