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.
sitemap-manager
Advanced tools
An easy way to create sitemaps!
Quick, Fast, And Beautiful!
First run
$ npm i sitemap-manager --save
or
$ yarn add sitemap-manager
Then just try it:
const { CreateSitemap, CreateIndexSitemap, CreateSitemapStylesheet } = require('sitemap-manager')
const data = {/* data here */} //see more in scripts/test.js
const siteURL = data.site.siteMetadata.siteUrl
const pathPrefix = '/aaa/'
// Create Sitemaps for each kind of pages.
CreateSitemap(
path.resolve('./public/sitemap-articles.xml'), // The path of the file which will be generated.
pathPrefix, // Prefix of the path. If your site doesn't at the root of the domain,just try this.
// Example:
// given path: /foo/
// handled path: /aaa/foo/
siteURL, // The domain of your site.
data.postsQuery.edges, // Your data, shoud be an array
(data) => { return data.node.fields.slug }, // How to turn the data to a path
)
CreateSitemap(
path.resolve('./public/sitemap-logs.xml'),
pathPrefix,
siteURL,
data.postsQuery.edges,
(data) => { return data.node.fields.slug + 'changelog/' },
)
CreateSitemap(
path.resolve('./public/sitemap-tags.xml'),
pathPrefix,
siteURL,
data.tagsQuery.group,
(data) => { return `/tags/${data.fieldValue}/` },
)
CreateSitemap(
path.resolve('./public/sitemap-pages.xml'),
pathPrefix,
siteURL,
['/pages/', '/settings/'],
(data) => { return data },
)
// Create an index for all sitemaps.
CreateIndexSitemap(
path.resolve('./public/sitemap.xml'), // The path of the file which will be generated.
pathPrefix, // Prefix of the path. If your site doesn't at the root of the domain,just try this.
siteURL, // The domain of your site.
['sitemap-pages.xml', 'sitemap-articles.xml', 'sitemap-logs.xml', 'sitemap-tags.xml'], // All the sitemaps should be here.
)
// Create the xml template file.
// !IMPORTANT
// Should be at the same dir as any other sitemaps.
// E.g.
// |
// \
// aaa
// | sitemap.xml
// | sitemap.xsl
// | sitemap-artcles.xml
// | sitemap-logs.xml
// ...
CreateSitemapStylesheet(
path.resolve('./public/sitemap.xsl'), // The path of the file which will be generated.
pathPrefix, // Prefix of the path. If your site doesn't at the root of the domain,just try this.
siteURL, // The domain of your site.
)
MIT
FAQs
An easy way to create sitemaps!
The npm package sitemap-manager receives a total of 18 weekly downloads. As such, sitemap-manager popularity was classified as not popular.
We found that sitemap-manager 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.